Re: [RFC PATCH v1 6/9] freezer: Set default freeze priority for zombie tasks

From: Oleg Nesterov
Date: Mon Aug 11 2025 - 05:45:42 EST


On 08/11, Zihuan Zhang wrote:
>
> 在 2025/8/8 22:29, Oleg Nesterov 写道:
> >On 08/07, Zihuan Zhang wrote:
> >>@@ -6980,6 +6981,7 @@ void __noreturn do_task_dead(void)
> >> current->flags |= PF_NOFREEZE;
> >>
> >> __schedule(SM_NONE);
> >>+ freeze_set_default_priority(current, FREEZE_PRIORITY_NEVER);
> >> BUG();
> >But this change has no effect?
> >
> >Firstly, this last __schedule() should not return, note the BUG() we have.
> >
> >Secondly, this zombie is already PF_NOFREEZE, freeze_task() will return
> >false anyway.
> Sorry, but in our tests with a large number of zombie tasks, returning early
> reduced the overhead. Even though freeze_task() would return false for
> PF_NOFREEZE, skipping the extra path still saved time in our suspend/freezer

https://lore.kernel.org/all/20250707084214.GD1613200@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/

Anyway the patch makes no sense in its current form, see my note
about __schedule() above.

Oleg.