Re: [PATCH v4] PM / Freezer: Skip zombie/dead processes to reduce freeze latency

From: Oleg Nesterov
Date: Wed Jul 16 2025 - 21:45:10 EST


On 07/17, Zihuan Zhang wrote:
>
> The main reason we didn’t rely directly on PF_NOFREEZE is that it’s a
> mutable flag — in some cases, it can be cleared later, which makes early
> skipping potentially unsafe.

Afaics userspace tasks can only set PF_NOFREEZE in do_task_dead() and never
clear it.

Apart from lock_system_sleep(). That is why (I think) Peter rightly suggests
to take system_transition_mutex in this function earlier.

> In contrast, exit_state is stable and skipping tasks based on it is safe.

I don't think it is really safe...

Oleg.