From: Peter Zijlstra <peterz@infradead.org>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Zihuan Zhang <zhangzihuan@kylinos.cn>,
"rafael J . wysocki" <rafael@kernel.org>,
len brown <len.brown@intel.com>, pavel machek <pavel@kernel.org>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] PM / Freezer: Skip zombie/dead processes to reduce freeze latency
Date: Wed, 16 Jul 2025 20:36:37 +0200 [thread overview]
Message-ID: <20250716183637.GJ4105545@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20250716163854.GE16401@redhat.com>
On Wed, Jul 16, 2025 at 06:38:55PM +0200, Oleg Nesterov wrote:
> On 07/16, Zihuan Zhang wrote:
> >
> > @@ -51,7 +51,15 @@ static int try_to_freeze_tasks(bool user_only)
> > todo = 0;
> > read_lock(&tasklist_lock);
> > for_each_process_thread(g, p) {
> > - if (p == current || !freeze_task(p))
> > + /*
> > + * Zombie and dead tasks are not running anymore and cannot enter
> > + * the __refrigerator(). Skipping them avoids unnecessary freeze attempts.
> > + *
> > + * TODO: Consider using PF_NOFREEZE instead, which may provide
> > + * a more generic exclusion mechanism for other non-freezable tasks.
> > + * However, for now, exit_state is sufficient to skip user processes.
>
> I don't really understand the comment... The freeze_task() paths already
> consider PF_NOFREEZE, although we can check it earlier as Peter suggests.
Right; I really don't understand why we should special case
->exit_state. Why not DTRT and optimize NOFREEZE if all this really
matters (smalls gains from what ISTR from the previous discussion).
next prev parent reply other threads:[~2025-07-16 18:36 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-16 6:26 [PATCH v4 0/1] PM / Freezer: Skip zombie/dead processes to reduce Zihuan Zhang
2025-07-16 6:26 ` [PATCH v4] PM / Freezer: Skip zombie/dead processes to reduce freeze latency Zihuan Zhang
2025-07-16 16:38 ` Oleg Nesterov
2025-07-16 18:36 ` Peter Zijlstra [this message]
2025-07-17 1:30 ` Zihuan Zhang
2025-07-17 1:43 ` Oleg Nesterov
2025-07-17 1:16 ` Zihuan Zhang
2025-07-17 1:31 ` Oleg Nesterov
2025-07-17 8:45 ` Zihuan Zhang
2025-07-16 12:26 ` [PATCH v4 0/1] PM / Freezer: Skip zombie/dead processes to reduce Rafael J. Wysocki
2025-07-17 1:02 ` Zihuan Zhang
2025-07-17 9:50 ` Rafael J. Wysocki
2025-07-21 10:39 ` Zihuan Zhang
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=20250716183637.GJ4105545@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=pavel@kernel.org \
--cc=rafael@kernel.org \
--cc=zhangzihuan@kylinos.cn \
/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®