Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1520230

Re: sched/autogroup: race if !sysctl_sched_autogroup_enabled ?

From Mike Galbraith <efault@gmx.de>
Newsgroups linux.kernel
Subject Re: sched/autogroup: race if !sysctl_sched_autogroup_enabled ?
Date 2016-11-12 13:20 +0100
Message-ID <sCFrP-1Yx-3@gated-at.bofh.it> (permalink)
References <sBEoa-1rS-29@gated-at.bofh.it> <sBFkd-20O-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, 2016-11-09 at 18:50 +0100, Peter Zijlstra wrote:
> On Wed, Nov 09, 2016 at 05:59:33PM +0100, Oleg Nesterov wrote:
> 
> > We need to ensure that autogroup/tg returned by autogroup_task_group()
> > can't go away if we race with autogroup_move_group(), and unless the
> > caller holds ->siglock we rely on fact that autogroup_move_group()
> > will a) see this task and b) do sched_move_task() which needs the same
> > same rq->lock.
> > 
> > However. autogroup_move_group() skips for_each_thread/sched_move_task
> > if sysctl_sched_autogroup_enabled == 0.
> > 
> > So. Doesn't this mean that cgroup migration to the root cgroup can race
> > with autogroup_move_group() and use the soon-to-be-freed autogroup->tg?
> 
> Argh, its too late for this, also jet-lag. But maybe, I can sort of feel
> a hole here but cannot for the life of me still think.
> 
> 
> > although this is a bit off-topic. Another question is that I fail to
> > understand why sched_autogroup_create_attach() does autogroup_create()
> > and changes signal->autogroup even if !sysctl_sched_autogroup_enabled.
> 
> I really cannot remember back that far, but it could be to allow
> flipping it back on. Then again, I don't think the fork path puts new
> tasks in, even if the autogroup exists.

Yeah, I've forgotten nearly everything about it too.  I do recall that
the autogroup always existed for both manual on/off and migrations
cgroup <--> root.

I think autogroup should go away.  Systemthing infestation is nearly
everywhere these days, and it wants to do ever more stupid shite that
will render it useless anyway.

	-Mike

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

sched/autogroup: race if !sysctl_sched_autogroup_enabled ? Oleg Nesterov <oleg@redhat.com> - 2016-11-09 18:00 +0100
  Re: sched/autogroup: race if !sysctl_sched_autogroup_enabled ? Peter Zijlstra <peterz@infradead.org> - 2016-11-09 19:00 +0100
    Re: sched/autogroup: race if !sysctl_sched_autogroup_enabled ? Oleg Nesterov <oleg@redhat.com> - 2016-11-10 14:20 +0100
      Re: sched/autogroup: race if !sysctl_sched_autogroup_enabled ? Oleg Nesterov <oleg@redhat.com> - 2016-11-11 18:00 +0100
        Re: sched/autogroup: race if !sysctl_sched_autogroup_enabled ? Mike Galbraith <efault@gmx.de> - 2016-11-13 15:00 +0100
          Re: sched/autogroup: race if !sysctl_sched_autogroup_enabled ? Oleg Nesterov <oleg@redhat.com> - 2016-11-14 16:20 +0100
    Re: sched/autogroup: race if !sysctl_sched_autogroup_enabled ? Mike Galbraith <efault@gmx.de> - 2016-11-12 13:20 +0100

csiph-web