aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c11
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
1532static struct sched_group *group_of(int cpu) 1537static 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
4889static inline int on_null_domain(int cpu) 4894static 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/*