Messages in this thread | | | From | Thomas Gleixner <> | Subject | Re: [patch 4/5] sched: Delay task stack freeing on RT | Date | Fri, 01 Oct 2021 22:54:08 +0200 |
| |
On Fri, Oct 01 2021 at 12:02, Andy Lutomirski wrote: > 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.
Right.
| |