Re: [PATCH] freezer,sched: Rewrite core freezer logic

From: Peter Zijlstra
Date: Mon Jun 14 2021 - 14:39:15 EST


On Mon, Jun 14, 2021 at 06:54:23PM +0200, Oleg Nesterov wrote:
> On 06/14, Peter Zijlstra wrote:

> > > I guess you do this to avoid freezable_schedule() in ptrace/signal_stop,
> > > and we can't use TASK_STOPPED|TASK_FREEZABLE, it should not run after
> > > thaw()... But see above, we can't rely on __frozen(parent).
> >
> > I do this because freezing puts a task in TASK_FROZEN, and that cannot
> > preserve TAKS_STOPPED or TASK_TRACED without being subject to wakups
>
> Yes, yes, this is what I tried to say.

OK, thanks for all that. Clearly I need to stare at this code longer and
harder.

One more thing; if I add additional state bits to preserve
__TASK_{TRACED,STOPPED}, then I need to figure out at thaw time if we've
missed a wakeup or not.

Do we have sufficient state for that? If so, don't we then also not have
sufficient state to tell if a task should've been TRACED/STOPPED in the
first place?

If not, I probably should add this... I'll go dig.