Re: [PATCH v4] PM / Freezer: Skip zombie/dead processes to reduce freeze latency
From: Oleg Nesterov
Date: Wed Jul 16 2025 - 21:34:11 EST
Hi Zihuan,
On 07/17, Zihuan Zhang wrote:
>
> >>+ */
> >>+ if (p == current || p->exit_state || !freeze_task(p))
> >> continue;
> >I leave this to you and Rafael, but this change doesn't look safe to me.
> >What if the exiting task does some IO after exit_notify() ?
>
> Tasks that have passed exit_notify() and entered EXIT_ZOMBIE are no longer
> schedulable,
How so? please look at do_exit(). The exiting task is still running
until it does its last __schedule() in do_task_dead().
> so they cannot do I/O anymore. Skipping them during freezing
> should be safe
Oleg.