diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2022-02-17 13:24:04 +0300 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2022-02-23 00:25:02 +0300 |
commit | 1a03d3f13ffe5dd24142d6db629e72c11b704d99 (patch) | |
tree | 84657d0e0eb3fb7653a15caf35822407dddb0274 /include/linux/sched | |
parent | f1c1a9ee00e4c53c9ccc03ec1aff4792948a25eb (diff) |
fork: Move task stack accounting to do_exit()
There is no need to perform the stack accounting of the outgoing task in
its final schedule() invocation which happens with preemption disabled.
The task is leaving, the resources will be freed and the accounting can
happen in do_exit() before the actual schedule invocation which
frees the stack memory.
Move the accounting of the stack memory from release_task_stack() to
exit_task_stack_account() which then can be invoked from do_exit().
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Andy Lutomirski <luto@kernel.org>
Link: https://lore.kernel.org/r/20220217102406.3697941-7-bigeasy@linutronix.de
Diffstat (limited to 'include/linux/sched')
-rw-r--r-- | include/linux/sched/task_stack.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/sched/task_stack.h b/include/linux/sched/task_stack.h index d10150587d81..892562ebbd3a 100644 --- a/include/linux/sched/task_stack.h +++ b/include/linux/sched/task_stack.h @@ -79,6 +79,8 @@ static inline void *try_get_task_stack(struct task_struct *tsk) static inline void put_task_stack(struct task_struct *tsk) {} #endif +void exit_task_stack_account(struct task_struct *tsk); + #define task_stack_end_corrupted(task) \ (*(end_of_stack(task)) != STACK_END_MAGIC) |