sched, nohz: Fix missing RCU read lock
authorPeter Zijlstra <peterz@infradead.org>
Wed, 7 Dec 2011 13:32:08 +0000 (14:32 +0100)
committerIngo Molnar <mingo@elte.hu>
Thu, 8 Dec 2011 04:45:48 +0000 (05:45 +0100)
commit067491b7313c41f49607fce782d29344d1472587
tree06f6352372038f7f4171c8d8fc869e686665d32f
parentcd490c5b285544dc1319cf79c2ca0528a6447f61
sched, nohz: Fix missing RCU read lock

Yong Zhang reported:

 > [ INFO: suspicious RCU usage. ]
 > kernel/sched/fair.c:5091 suspicious rcu_dereference_check() usage!

This is due to the sched_domain stuff being RCU protected and
commit 0b005cf5 ("sched, nohz: Implement sched group, domain
aware nohz idle load balancing") overlooking this fact.

The sd variable only lives inside the for_each_domain() block,
so we only need to wrap that.

Reported-by: Yong Zhang <yong.zhang0@gmail.com>
Tested-by: Yong Zhang <yong.zhang0@gmail.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Link: http://lkml.kernel.org/r/1323264728.32012.107.camel@twins
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/sched/fair.c