lkml.org 
[lkml]   [2021]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [patch 4/5] sched: Delay task stack freeing on RT
On Fri, Oct 1, 2021 at 11:48 AM Andy Lutomirski <luto@kernel.org> wrote:
>
> On Fri, Oct 1, 2021 at 10:24 AM Thomas Gleixner <tglx@linutronix.de> wrote:
> >

> ISTM it would be conceptually for do_exit() to handle its own freeing
> in its own preemptible context. Obviously that can't really work,
> since we can't free a task_struct or a task stack while we're running
> on it. But I wonder if we could approximate it by putting this work
> in a workqueue so that it all runs in a normal schedulable context.
> To make the shell script case work nicely, we want to release the task
> stack before notifying anyone waiting for the dying task to exit, but
> maybe that's doable. It could involve some nasty exit_signal hackery,
> though.

I'm making this way more complicated than it needs to be. How about
we unaccount the task stack in do_exit and release it for real in
finish_task_switch()? Other than accounting, free_thread_stack
doesn't take any locks.

--Andy

\
 
 \ /
  Last update: 2021-10-01 21:03    [W:0.044 / U:2.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site