]> git.baikalelectronics.ru Git - kernel.git/commit
sched/autogroup: Fix crash on reboot when autogroup is disabled
authorMike Galbraith <efault@gmx.de>
Sun, 28 Oct 2012 19:19:23 +0000 (12:19 -0700)
committerIngo Molnar <mingo@kernel.org>
Tue, 30 Oct 2012 09:26:04 +0000 (10:26 +0100)
commit1bfb81534da98a9affa6dba8e7269edb82b948c4
treec97487f040b95f83a2c9d31d51cbfe57f35e59e3
parent61e2b032bddf6d267d442569821d658234368c25
sched/autogroup: Fix crash on reboot when autogroup is disabled

Due to these two commits:

  0dd5952b10bd sched: Fix race in task_group()
  6ff4c90f02fd sched, autogroup: Stop going ahead if autogroup is disabled

... autogroup scheduling's dynamic knobs are wrecked.

With both patches applied, all you have to do to crash a box is
disable autogroup during boot up, then reboot.. boom, NULL pointer
dereference due to 6ff4c90f not allowing autogroup to move things,
and 0dd5952b1 making that the only way to switch runqueues.

Remove most of the (dysfunctional) knobs and turn the remaining
sched_autogroup_enabled knob readonly.

If the user fiddles with cgroups hereafter, once tasks
are moved, autogroup won't mess with them again unless
they call setsid().

No knobs, no glitz, nada, just a cute little thing folks can
turn on if they don't want to muck about with cgroups and/or
systemd.

Signed-off-by: Mike Galbraith <efault@gmx.de>
Cc: Xiaotian Feng <xtfeng@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Xiaotian Feng <dannyfeng@tencent.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: <stable@vger.kernel.org> # v3.6
Link: http://lkml.kernel.org/r/1351451963.4999.8.camel@maggy.simpson.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
fs/proc/base.c
kernel/sched/auto_group.c
kernel/sched/auto_group.h
kernel/sysctl.c