diff options
| author | Christian Brauner <brauner@kernel.org> | 2026-09-10 17:48:10 +0200 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2026-10-05 13:11:49 +0200 |
| commit | c26b947a9a31a32cf53a48c55cc7a4aa288aedf7 (patch) | |
| tree | e70e4bcd36d222e5f5671bb6fcdf97a321a18997 /include/linux | |
| parent | 5d075bd77ffbced7863d31e22cb2e7107e1ab957 (diff) | |
| download | linux-c26b947a9a31a32cf53a48c55cc7a4aa288aedf7.tar.gz linux-c26b947a9a31a32cf53a48c55cc7a4aa288aedf7.zip | |
coredump: replace the startup completion with a thread count
coredump_wait() sets core_state->nr_threads to the number of tasks
killed and waits for the last thread to enter coredump_task_exit() to
signal completion. Let's just wait on the count directly. The exiting
tasks can use atomic_dec_and_wake_up() and the dumping task sleeps in
wait_var_event_state().
The dumping task must remain freezable since commit f5d39b020809
("freezer,sched: Rewrite core freezer logic"). So keep the wait
TASK_UNINTERRUPTIBLE|TASK_FREEZABLE.
Drop the completion and rename nr_threads to threads_remaining.
No functional changes.
Suggested-by: NeilBrown <neilb@ownmail.net>
Link: https://lore.kernel.org/178899497961.207413.10554121774377911612@noble.neil.brown.name
Link: https://patch.msgid.link/20260910-work-coredump-unlock-self-v4-12-a5c1800dc930@kernel.org
Reviewed-by: NeilBrown <neil@brown.name>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/sched/signal.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/sched/signal.h b/include/linux/sched/signal.h index 14b55d00d605..e039e29cd8c5 100644 --- a/include/linux/sched/signal.h +++ b/include/linux/sched/signal.h @@ -79,9 +79,9 @@ struct core_thread { }; struct core_state { - atomic_t nr_threads; + /* Threads the dumper still waits for. */ + atomic_t threads_remaining; struct core_thread *tasks; - struct completion startup; }; /* |
