sched, autogroup: Stop going ahead if autogroup is disabled
authorYong Zhang <yong.zhang0@gmail.com>
Sun, 20 Feb 2011 07:08:14 +0000 (15:08 +0800)
committerIngo Molnar <mingo@elte.hu>
Wed, 23 Feb 2011 10:33:59 +0000 (11:33 +0100)
commit800d4d30c8f20bd728e5741a3b77c4859a613f7c
tree1eb329fb8a1dce1c1432c07e19494a3e1fb68499
parent1747b21fecbfb63fbf6b9624e8b92707960d5a97
sched, autogroup: Stop going ahead if autogroup is disabled

when autogroup is disable from the beginning,
sched_autogroup_create_attach()
  autogroup_move_group()                    <== 1
    sched_move_task()                       <== 2
      task_move_group_fair()
        set_task_rq()
          task_group()
            autogroup_task_group()

We go the whole path without doing anything useful.

Then stop going further if autogroup is disabled.

But there will be a race window between 1 and 2, in which
sysctl_sched_autogroup_enabled is enabled. This issue
will be toke by following patch.

Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
LKML-Reference: <1298185696-4403-4-git-send-email-yong.zhang0@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/sched_autogroup.c
kernel/sched_autogroup.h