lkml.org 
[lkml]   [2018]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v3 4/7] cgroup: cgroup v2 freezer
Date
On Tue, Nov 20, 2018 at 08:36:04AM -0800, Tejun Heo wrote:
> On Tue, Nov 20, 2018 at 04:33:11PM +0000, Roman Gushchin wrote:
> > > If a non-frozen task is being moved into a frozen cgroup, shouldn't
> > > that also trigger frozen state update?
> >
> > It does! Just below these lines:
> >
> > /*
> > * If the task isn't in the desired state, force it to it.
> > */
> > if (task->frozen != test_bit(CGRP_FREEZE, &dst->flags))
> > cgroup_freeze_task(task, test_bit(CGRP_FREEZE, &dst->flags));
>
> But that wouldn't udpate the cgroup's frozen state and generate
> notifications, right?

Why? The task will be eventually trapped into cgroup_enter_frozen(),
and from there cgroup_update_frozen() will be called.

You are right, that notification will not be issued, because the cgroup
is not changing its state (frozen->frozen). I'm not sure that it makes
sense to change the cgroup state back and forth in this case. Are there
any reasons I'm missing?

Thanks!

\
 
 \ /
  Last update: 2018-11-20 17:46    [W:0.104 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site