diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2010-02-22 20:04:50 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-02-25 04:34:26 -0500 |
commit | d11c563dd20ff35da5652c3e1c989d9e10e1d6d0 (patch) | |
tree | b189f50de7a01d7603935d4da7e755d764dfe67e /kernel/sched.c | |
parent | a898def29e4119bc01ebe7ca97423181f4c0ea2d (diff) |
sched: Use lockdep-based checking on rcu_dereference()
Update the rcu_dereference() usages to take advantage of the new
lockdep-based checking.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: laijs@cn.fujitsu.com
Cc: dipankar@in.ibm.com
Cc: mathieu.desnoyers@polymtl.ca
Cc: josh@joshtriplett.org
Cc: dvhltc@us.ibm.com
Cc: niv@us.ibm.com
Cc: peterz@infradead.org
Cc: rostedt@goodmis.org
Cc: Valdis.Kletnieks@vt.edu
Cc: dhowells@redhat.com
LKML-Reference: <1266887105-1528-6-git-send-email-paulmck@linux.vnet.ibm.com>
[ -v2: fix allmodconfig missing symbol export build failure on x86 ]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 3a8fb30a91b1..70ae68680d4c 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -645,6 +645,11 @@ static inline int cpu_of(struct rq *rq) | |||
645 | #endif | 645 | #endif |
646 | } | 646 | } |
647 | 647 | ||
648 | #define for_each_domain_rd(p) \ | ||
649 | rcu_dereference_check((p), \ | ||
650 | rcu_read_lock_sched_held() || \ | ||
651 | lockdep_is_held(&sched_domains_mutex)) | ||
652 | |||
648 | /* | 653 | /* |
649 | * The domain tree (rq->sd) is protected by RCU's quiescent state transition. | 654 | * The domain tree (rq->sd) is protected by RCU's quiescent state transition. |
650 | * See detach_destroy_domains: synchronize_sched for details. | 655 | * See detach_destroy_domains: synchronize_sched for details. |
@@ -653,7 +658,7 @@ static inline int cpu_of(struct rq *rq) | |||
653 | * preempt-disabled sections. | 658 | * preempt-disabled sections. |
654 | */ | 659 | */ |
655 | #define for_each_domain(cpu, __sd) \ | 660 | #define for_each_domain(cpu, __sd) \ |
656 | for (__sd = rcu_dereference(cpu_rq(cpu)->sd); __sd; __sd = __sd->parent) | 661 | for (__sd = for_each_domain_rd(cpu_rq(cpu)->sd); __sd; __sd = __sd->parent) |
657 | 662 | ||
658 | #define cpu_rq(cpu) (&per_cpu(runqueues, (cpu))) | 663 | #define cpu_rq(cpu) (&per_cpu(runqueues, (cpu))) |
659 | #define this_rq() (&__get_cpu_var(runqueues)) | 664 | #define this_rq() (&__get_cpu_var(runqueues)) |
@@ -1531,7 +1536,7 @@ static unsigned long target_load(int cpu, int type) | |||
1531 | 1536 | ||
1532 | static struct sched_group *group_of(int cpu) | 1537 | static struct sched_group *group_of(int cpu) |
1533 | { | 1538 | { |
1534 | struct sched_domain *sd = rcu_dereference(cpu_rq(cpu)->sd); | 1539 | struct sched_domain *sd = rcu_dereference_sched(cpu_rq(cpu)->sd); |
1535 | 1540 | ||
1536 | if (!sd) | 1541 | if (!sd) |
1537 | return NULL; | 1542 | return NULL; |
@@ -4888,7 +4893,7 @@ static void run_rebalance_domains(struct softirq_action *h) | |||
4888 | 4893 | ||
4889 | static inline int on_null_domain(int cpu) | 4894 | static inline int on_null_domain(int cpu) |
4890 | { | 4895 | { |
4891 | return !rcu_dereference(cpu_rq(cpu)->sd); | 4896 | return !rcu_dereference_sched(cpu_rq(cpu)->sd); |
4892 | } | 4897 | } |
4893 | 4898 | ||
4894 | /* | 4899 | /* |