Index: linux-2.6.31-bfs/kernel/sched_bfs.c =================================================================== --- linux-2.6.31-bfs.orig/kernel/sched_bfs.c 2009-09-08 16:37:31.248262129 +1000 +++ linux-2.6.31-bfs/kernel/sched_bfs.c 2009-09-08 16:49:06.706262125 +1000 @@ -1029,6 +1029,7 @@ long old_state; struct rq *rq; + smp_wmb(); rq = time_task_grq_lock(p, &flags); old_state = p->state; if (!(old_state & state)) @@ -4803,6 +4804,15 @@ return group; } +/** + * group_first_cpu - Returns the first cpu in the cpumask of a sched_group. + * @group: The group whose first cpu is to be returned. + */ +static inline unsigned int group_first_cpu(struct sched_group *group) +{ + return cpumask_first(sched_group_cpus(group)); +} + #ifdef CONFIG_NUMA /* * The init_sched_build_groups can't handle what we want to do with node @@ -4898,15 +4908,6 @@ } #endif /* CONFIG_NUMA */ -/** - * group_first_cpu - Returns the first cpu in the cpumask of a sched_group. - * @group: The group whose first cpu is to be returned. - */ -static inline unsigned int group_first_cpu(struct sched_group *group) -{ - return cpumask_first(sched_group_cpus(group)); -} - /* * Initialize sched groups cpu_power. * @@ -5719,8 +5720,12 @@ int highest_cpu = 0; prio_ratios[0] = 100; + /* + * Each next nice value has ~85% cpu of the previous value. This + * gives nice +19 ~5% cpu of nice 0. + */ for (i = 1 ; i < PRIO_RANGE ; i++) - prio_ratios[i] = prio_ratios[i - 1] * 11 / 10; + prio_ratios[i] = prio_ratios[i - 1] * 117 / 100; #ifdef CONFIG_SMP init_defrootdomain();