Skip to contentSkip to conversation

sched: fix list traversal to use _rcu variant

PATCH Applied Chris Friesen 2 participants 2 messages Sep 22, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched: fix list traversal to use _rcu variant

From: Chris Friesen <[email protected]>

load_balance_fair() calls rcu_read_lock() but then traverses the list using the regular list traversal routine. This patch converts the list traversal to use the _rcu version.

Approval token "Nortel-02-July-2008-01"
Cc: Peter Zijlstra <[email protected]>
Cc: Ingo Molnar <[email protected]>

---

kernel/sched_fair.c +0 -0
index fb8994c..3c8f631 100644
@@ -1507,7 +1507,7 @@ load_balance_fair(struct rq *this_rq, int this_cpu, struct rq *busiest,
	rcu_read_lock();
	update_h_load(busiest_cpu);

- list_for_each_entry(tg, &task_groups, list) {

+	list_for_each_entry_rcu(tg, &task_groups, list) {
		struct cfs_rq *busiest_cfs_rq = tg->cfs_rq[busiest_cpu];
		unsigned long busiest_h_load = busiest_cfs_rq->h_load;
		unsigned long busiest_weight = busiest_cfs_rq->load.weight;
Applied
#1 lore raw
Quoted 10 lines · Chris Friesen

From: Chris Friesen <[email protected]>

load_balance_fair() calls rcu_read_lock() but then traverses the list using the regular list traversal routine. This patch converts the list traversal to use the _rcu version.

Approval token "Nortel-02-July-2008-01"
Cc: Peter Zijlstra <[email protected]>
Cc: Ingo Molnar <[email protected]>

applied to tip/sched/devel, thanks Chris!

Ingo