From: Oleg Nesterov <oleg@redhat.com>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: linux-kernel@vger.kernel.org, axboe@kernel.dk,
brauner@kernel.org, akpm@linux-foundation.org,
willy@infradead.org, clm@fb.com, riel@surriel.com,
ffledgling@meta.com
Subject: Re: [PATCH RFC exit] Sleep at TASK_IDLE when waiting for application core dump
Date: Thu, 25 Jul 2024 19:09:52 +0200 [thread overview]
Message-ID: <20240725170951.GB6602@redhat.com> (raw)
In-Reply-To: <21406a91-8801-453a-9833-a4e24c7e90ca@paulmck-laptop>
On 07/25, Paul E. McKenney wrote:
>
> How does the updated patch shown below look to you?
Thanks, looks good to me ;)
Oleg.
> ------------------------------------------------------------------------
>
> commit a6c7779283d67a409b81616a5b485ac21637d7e7
> Author: Paul E. McKenney <paulmck@kernel.org>
> Date: Wed Jul 24 16:51:52 2024 -0700
>
> exit: Sleep at TASK_IDLE when waiting for application core dump
>
> 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 <ffledgling@meta.com>
> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
> Acked-by: Oleg Nesterov <oleg@redhat.com>
> Cc: Jens Axboe <axboe@kernel.dk>
> Cc: Christian Brauner <brauner@kernel.org>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>
> Cc: Chris Mason <clm@fb.com>
> Cc: Rik van Riel <riel@surriel.com>
>
> diff --git a/kernel/exit.c b/kernel/exit.c
> index f95a2c1338a8..b0d18f7b6d15 100644
> --- a/kernel/exit.c
> +++ b/kernel/exit.c
> @@ -429,7 +429,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();
>
prev parent reply other threads:[~2024-07-25 17:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-25 0:04 [PATCH RFC exit] Sleep at TASK_IDLE when waiting for application core dump Paul E. McKenney
2024-07-25 13:29 ` Oleg Nesterov
2024-07-25 16:24 ` Paul E. McKenney
2024-07-25 17:09 ` Oleg Nesterov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240725170951.GB6602@redhat.com \
--to=oleg@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=brauner@kernel.org \
--cc=clm@fb.com \
--cc=ffledgling@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@kernel.org \
--cc=riel@surriel.com \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox