Skip to contentSkip to conversation

sched: Modified nice support for SMP load balancing

RFC PATCH New Peter Williams 1 participant 1 message Sep 16, 2005 Scheduler

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 sched: Modified nice support for SMP load balancing

The attached patch is a modified version of Con Kolivas's patch to add "nice" support to load balancing across physical CPUs on SMP systems.

The principal modifications to the Con's mechanism are changing move_tasks() so that it endeavours to move a specified amount of biased load rather than a specified number of tasks, changing find_busiest_group() so that the value returned in "imbalance" is in terms of biased load rather than number of tasks and changing rebalance_tick() to calculate "cpu_load" for each run queue as biased load rather than plain load. To be more precise, because of the special case of active_load_balance() wanting to move exactly 1 task, move_tasks() actually moves up to a given number of tasks or up to a given amount of biased load.

Because these changes mean that tasks' biased prio is evaluated much more often than in the original implementation a "bias_prio" field has been added to the task structure to hold its value meaning that it only needs to be calculated when the task's nice or scheduling class is changed. This change facilitates considerable simplification of much of the code.

Peter

Signature · 4 lines
Peter Williams                                   [email protected]

"Learning, n. The kind of ignorance distinguishing the studious."
 -- Ambrose Bierce
include/linux/sched.h +3 -0
Index: Linux-2.6.X/include/linux/sched.h
===================================================================
@@ -640,6 +640,9 @@ struct task_struct {
 	int oncpu;
 #endif
 	int prio, static_prio;
+#ifdef CONFIG_SMP
+	int bias_prio;
+#endif
 	struct list_head run_list;
 	prio_array_t *array;
 
kernel/sched.c +112 -21

301 lines not on this page · raw message