sched-implement-smpnice-2.6.17
PATCH 1/29 sched-implement-smpnice-2.6.17
To aid in avoiding the subversion of "niceness" due to uneven distribution of tasks with abnormal "nice" values across CPUs the contribution that each task makes to its run queue's load is weighted according to its scheduling class and "nice" value. For SCHED_NORMAL tasks this is just a scaled version of the new time slice allocation that they receive on time slice expiry etc.
Signed-off-by Peter Williams <[email protected]>
Signed-off-by Con Kolivas <[email protected]>
--- include/linux/sched.h | 8 - kernel/sched.c | 313 +++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 253 insertions(+), 68 deletions(-)
include/linux/sched.h +6 -2
@@ -102,6 +102,7 @@ extern unsigned long nr_running(void);extern unsigned long nr_uninterruptible (void );extern unsigned long nr_active (void );extern unsigned long nr_iowait (void ); +extern unsigned long weighted_cpuload (const int cpu);#include <linux/time.h> #include <linux/param.h>
@@ -547,9 +548,9 @@ enum idle_type/* * sched-domains (multiprocessor balancing) declarations: */ -#ifdef CONFIG_SMP #define SCHED_LOAD_SCALE 128UL/* increase resolution of load */ +#ifdef CONFIG_SMP #define SD_LOAD_BALANCE 1/* Do load balancing on this domain. */ #define SD_BALANCE_NEWIDLE 2/* Balance when about to become idle */ #define SD_BALANCE_EXEC 4/* Balance on exec */
@@ -702,9 +703,12 @@ struct task_struct {int lock_depth;/* BKL lock depth */ -#if defined(CONFIG_SMP ) && defined(__ARCH_WANT_UNLOCKED_CTXSW) +#ifdef CONFIG_SMP +#ifdef __ARCH_WANT_UNLOCKED_CTXSWint oncpu;#endif +#endif +int load_weight;/* for niceness load balancing purposes */ int prio, static_prio;struct list_head run_list;prio_array_t *array;
kernel/sched.c +247 -66
618 lines not on this page · raw message
Signature · 1 line
-ck