]> Git Repo - J-linux.git/commitdiff
exit: Sleep at TASK_IDLE when waiting for application core dump
authorPaul E. McKenney <[email protected]>
Wed, 24 Jul 2024 23:51:52 +0000 (16:51 -0700)
committerPaul E. McKenney <[email protected]>
Fri, 2 Aug 2024 17:55:04 +0000 (10:55 -0700)
Currently, the coredump_task_exit() function sets the task state
to TASK_UNINTERRUPTIBLE|TASK_FREEZABLE, which usually works well.
But a combination of large memory and slow (and/or highly contended)
mass storage can cause application core dumps to take more than
two minutes, which can cause check_hung_task(), which is invoked by
check_hung_uninterruptible_tasks(), to produce task-blocked splats.
There does not seem to be any reasonable benefit to getting these splats.

Furthermore, as Oleg Nesterov points out, TASK_UNINTERRUPTIBLE could
be misleading because the task sleeping in coredump_task_exit() really
is killable, albeit indirectly.  See the check of signal->core_state
in prepare_signal() and the check of fatal_signal_pending()
in dump_interrupted(), which bypass the normal unkillability of
TASK_UNINTERRUPTIBLE, resulting in coredump_finish() invoking
wake_up_process() on any threads sleeping in coredump_task_exit().

Therefore, change that TASK_UNINTERRUPTIBLE to TASK_IDLE.

Reported-by: Anhad Jai Singh <[email protected]>
Signed-off-by: Paul E. McKenney <[email protected]>
Acked-by: Oleg Nesterov <[email protected]>
Cc: Jens Axboe <[email protected]>
Cc: Christian Brauner <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Matthew Wilcox (Oracle)" <[email protected]>
Cc: Chris Mason <[email protected]>
Cc: Rik van Riel <[email protected]>
kernel/exit.c

index 7430852a857129873f2faf20b933840f4c02f604..0d62a53605dfc2a1d8b05ff95e734a176f5f9a09 100644 (file)
@@ -428,7 +428,7 @@ static void coredump_task_exit(struct task_struct *tsk)
                        complete(&core_state->startup);
 
                for (;;) {
-                       set_current_state(TASK_UNINTERRUPTIBLE|TASK_FREEZABLE);
+                       set_current_state(TASK_IDLE|TASK_FREEZABLE);
                        if (!self.task) /* see coredump_finish() */
                                break;
                        schedule();
This page took 0.052294 seconds and 4 git commands to generate.