Re: [PATCH v8 4/7] cgroup: cgroup v2 freezer

From: Oleg Nesterov
Date: Thu Feb 21 2019 - 11:44:08 EST


On 02/20, Roman Gushchin wrote:
>
> On Wed, Feb 20, 2019 at 03:42:02PM +0100, Oleg Nesterov wrote:
> > On 02/19, Roman Gushchin wrote:
> > >
> > > @@ -2363,7 +2419,8 @@ bool get_signal(struct ksignal *ksig)
> > > * we should notify the parent, prepare_signal(SIGCONT) encodes
> > > * the CLD_ si_code into SIGNAL_CLD_MASK bits.
> > > */
> > > - if (unlikely(signal->flags & SIGNAL_CLD_MASK)) {
> > > + if (unlikely(signal->flags & SIGNAL_CLD_MASK) &
> > > + !(current->jobctl & JOBCTL_TRAP_FREEZE)) {
> >
> > Hmm, why?
>
> If a process is going from the stopped to the frozen state, it looks like
> it's better to delay parent's notification up to the moment when it will
> actually run.

Perhaps I missed something but I do not understand why it is really better,
at least why it deserves this (small but still) complication...

OK, if nothing else, suppose that SIGCONT races with cgroup_do_freeze(true).
With or without this change CLD_CONTINUED can be reported or not depending
on /dev/random, do we really care?

Oleg.