Re: [PATCH next] sched,freezer: prevent tasks from escaping being frozen

From: Michal Koutný
Date: Mon Jul 07 2025 - 12:39:32 EST


On Fri, Jul 04, 2025 at 11:02:52AM +0800, Chen Ridong <chenridong@xxxxxxxxxxxxxxx> wrote:
> Regarding your question: Did you mean that the task was frozen, received
> another signal to wake up, but should have remained frozen instead of
> entering the running state?

My response was a knee-jerk after seeing the move inside the loop.
Since the task is in __refrigerator(), it would've been already frozen,
so the 2nd (and more) checks should be OK and it wouldn't escape
freezing despite the concurrent reader.

A task in __refrigerator() shouldn't be woken up by a signal, no? So
your original conservative fix might have been sufficient afterall.
(A conservative fix is what I'd strive for here, given it's the legacy
cgroup freezer.)

Thanks,
Michal

Attachment: signature.asc
Description: PGP signature