sched: use RCU variant of list traversal in for_each_leaf_rt_rq()
authorBharata B Rao <bharata@linux.vnet.ibm.com>
Mon, 15 Dec 2008 06:26:48 +0000 (11:56 +0530)
committerIngo Molnar <mingo@elte.hu>
Tue, 16 Dec 2008 20:39:14 +0000 (21:39 +0100)
Impact: fix potential of rare crash

for_each_leaf_rt_rq() walks an RCU protected list (rq->leaf_rt_rq_list),
but doesn't use list_for_each_entry_rcu(). Fix this.

Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/sched_rt.c

index d9ba9d5f99d6af74b7c1db5ff5814c15900b68b0..7bdf84c85ccd82381e3880b7812f88aa42db7b7c 100644 (file)
@@ -77,7 +77,7 @@ static inline u64 sched_rt_period(struct rt_rq *rt_rq)
 }
 
 #define for_each_leaf_rt_rq(rt_rq, rq) \
-       list_for_each_entry(rt_rq, &rq->leaf_rt_rq_list, leaf_rt_rq_list)
+       list_for_each_entry_rcu(rt_rq, &rq->leaf_rt_rq_list, leaf_rt_rq_list)
 
 static inline struct rq *rq_of_rt_rq(struct rt_rq *rt_rq)
 {