Re: [PATCH] arm64/gcs: Don't call gcs_free() during flush_gcs()
From: Mark Brown
Date: Thu Jun 12 2025 - 12:44:31 EST
On Thu, Jun 12, 2025 at 05:20:28PM +0100, Will Deacon wrote:
> Having looking a little at the code, I think that
> arch_release_task_struct() might be better than deactivate_mm(). The
> latter takes an 'mm' parameter which we ignore but I think happens to
> be 'current->mm'and so things work. Given that, and that we don't do any
> GCS management on the activate_mm() path, freeing the GCS in the
> task-centric functions makes more sense to me.
The issue with that is that we only call arch_release_task_struct()
quite late, after the mm has been disassociated from the task.
do_exit() cleans up the mm with exit_mm() relatively early on, and
free_task() which is what calls arch_release_task_struct() is one of the
last things we do as we clean up.
Attachment:
signature.asc
Description: PGP signature