Skip to content

Commit ae577ea

Browse files
author
Peter Zijlstra
committed
unwind: Add comment to unwind_deferred_task_exit()
Explain why unwind_deferred_task_exit() exist and its constraints. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org> Link: https://patch.msgid.link/20250924080118.893367437@infradead.org
1 parent 52a1ec7 commit ae577ea

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

kernel/exit.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,6 @@ void __noreturn do_exit(long code)
939939

940940
tsk->exit_code = code;
941941
taskstats_exit(tsk, group_dead);
942-
unwind_deferred_task_exit(tsk);
943942
trace_sched_process_exit(tsk, group_dead);
944943

945944
/*
@@ -950,6 +949,12 @@ void __noreturn do_exit(long code)
950949
* gets woken up by child-exit notifications.
951950
*/
952951
perf_event_exit_task(tsk);
952+
/*
953+
* PF_EXITING (above) ensures unwind_deferred_request() will no
954+
* longer add new unwinds. While exit_mm() (below) will destroy the
955+
* abaility to do unwinds. So flush any pending unwinds here.
956+
*/
957+
unwind_deferred_task_exit(tsk);
953958

954959
exit_mm();
955960

0 commit comments

Comments
 (0)