mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Aviv Vaknin <vaknins33@gmail.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>
Cc: Christian Brauner <brauner@kernel.org>,
	Pavel Tikhomirov <ptikhomirov@virtuozzo.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] pid_namespace: make zap_pid_ns_processes() freezable
Date: Fri, 2 Oct 2026 16:26:12 +0200	[thread overview]
Message-ID: <ar-_BMp5cuPwDw5J@redhat.com> (raw)
In-Reply-To: <20261001121254.883973-1-vaknins33@gmail.com>

On 10/01, Aviv Vaknin wrote:
>
> Fixes: 3eb07c8c8adb ("pid namespaces: destroy pid namespace on init's death")
> Fixes: b9a985db9896 ("pid_ns: Sleep in TASK_INTERRUPTIBLE in zap_pid_ns_processes")
> Cc: stable@vger.kernel.org # 6.1+
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: Aviv Vaknin <vaknins33@gmail.com>

OK, since Rafael agrees with this patch

Acked-by: Oleg Nesterov <oleg@redhat.com>


but see below...

> @@ -243,6 +244,11 @@ void zap_pid_ns_processes(struct pid_namespace *pid_ns)
>  	do {
>  		clear_thread_flag(TIF_SIGPENDING);
>  		rc = kernel_wait4(-1, NULL, __WALL, NULL);
> +		/*
> +		 * The freezer's fake signal ends the wait with -ERESTARTSYS;
> +		 * freeze here, or one stuck pid namespace blocks suspend.
> +		 */
> +		try_to_freeze();
>  	} while (rc != -ECHILD);

Somehow I still think it would be better to change do_wait() to use
TASK_INTERRUPTIBLE | TASK_FREEZABLE. Slightly less robust in theory,
but I think should work in practice...

Rafael, what do you think?

>  	for (;;) {
> -		set_current_state(TASK_INTERRUPTIBLE);
> +		/*
> +		 * TASK_IDLE: no hung task warning or load for a wait that can
> +		 * last as long as a tracer keeps a zombie, and a pending signal
> +		 * (e.g. the freezer's fake one) can't turn it into a busy loop.
> +		 * TASK_FREEZABLE: let the freezer freeze us while we wait.
> +		 */
> +		set_current_state(TASK_IDLE | TASK_FREEZABLE);

This looks like overdocumentation to me. I guess it was added by AI. Other users
of IDLE/FREEZABLE do not try to document the meaning of these task states.

But this is subjective, I won't insist.

Oleg.


  parent reply	other threads:[~2026-10-02 14:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-01 12:12 Aviv Vaknin
2026-10-01 13:03 ` Rafael J. Wysocki (Intel)
2026-10-01 15:35 ` Oleg Nesterov
2026-10-01 16:53 ` Bradley Morgan
2026-10-02 14:26 ` Oleg Nesterov [this message]
2026-10-02 16:24   ` Rafael J. Wysocki (Intel)
2026-10-02 18:06     ` Oleg Nesterov
2026-10-02 18:13       ` Rafael J. Wysocki (Intel)
2026-10-02 20:28         ` Aviv Vaknin

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=ar-_BMp5cuPwDw5J@redhat.com \
    --to=oleg@redhat.com \
    --cc=brauner@kernel.org \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=ptikhomirov@virtuozzo.com \
    --cc=rafael@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=vaknins33@gmail.com \
    /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

all inboxes | Powered by JetHome®