Skip to contentSkip to conversation

sched: Consolidated and improved smpnice patch

PATCH In review Peter Williams 2 participants 7 messages Feb 20, 2006 – Feb 22, 2006 Scheduler

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched: Consolidated and improved smpnice patch

Problem:

The introduction of separate run queues per CPU has brought with it "nice" enforcement problems that are best described by a simple example.
For the sake of argument suppose that on a single CPU machine with a
nice==19 hard spinner and a nice==0 hard spinner running that the nice==0 task gets 95% of the CPU and the nice==19 task gets 5% of the CPU. Now suppose that there is a system with 2 CPUs and 2 nice==19 hard spinners and 2 nice==0 hard spinners running. The user of this system would be entitled to expect that the nice==0 tasks each get 95% of a CPU and the nice==19 tasks only get 5% each. However, whether this expectation is met is pretty much down to luck as there are four equally likely distributions of the tasks to the CPUs that the load balancing code will consider to be balanced with loads of 2.0 for each CPU. Two of these distributions involve one nice==0 and one nice==19 task per CPU and in these circumstances the users expectations will be met. The other two distributions both involve both nice==0 tasks being on one CPU and both nice==19 being on the other CPU and each task will get 50% of a CPU and the user's expectations will not be met.

Solution:

The solution to this problem that is implemented in the attached patch is to use weighted loads when determining if the system is balanced and, when an imbalance is detected, to move an amount of weighted load between run queues (as opposed to a number of tasks) to restore the balance. Once again, the easiest way to explain why both of these measures are necessary is to use a simple example. Suppose that (in a slight variation of the above example) that we have a two CPU system with 4 nice==0 and 4 nice=19 hard spinning tasks running and that the 4 nice==0 tasks are on one CPU and the 4 nice==19 tasks are on the other CPU. The weighted loads for the two CPUs would be 4.0 and 0.2 respectively and the load balancing code would move 2 tasks resulting in one CPU with a load of 2.0 and the other with load of 2.2. If this was considered to be a big enough imbalance to justify moving a task and that task was moved using the current move_tasks() then it would move the highest priority task that it found and this would result in one CPU with a load of 3.0 and the other with a load of 1.2 which would result in the movement of a task in the opposite direction and so on -- infinite loop. If, on the other hand, an amount of load to be moved is calculated from the imbalance (in this case 0.1) and move_tasks() skips tasks until it find ones whose contributions to the weighted load are less than this amount it would move two of the nice==19 tasks resulting in a system with 2 nice==0 and 2 nice=19 on each CPU with loads of 2.1 for each CPU.

One of the advantages of this mechanism is that on a system where all tasks have nice==0 the load balancing calculations would be mathematically identical to the current load balancing code.

Notes:

struct task_struct:

has a new filed load_weight which (in a trade off of space for speed) stores the contribution that this task makes to a CPU's weighted load when it is runnable.

struct runqueue:

has a new field raw_weighted_load which is the sum of the load_weight values for the currently runnable tasks on this run queue. This field always needs to be updated when nr_running is updated so two new inline functions inc_nr_running() and dec_nr_running() have been created to make sure that this happens. This also offers a convenient way to optimize away this part of the smpnice mechanism when CONFIG_SMP is not defined.

int try_to_wake_up():

in this function the value SCHED_LOAD_BALANCE is used to represent the load contribution of a single task in various calculations in the code that decides which CPU to put the waking task on. While this would be a valid on a system where the nice values for the runnable tasks were distributed evenly around zero it will lead to anomalous load balancing if the distribution is skewed in either direction. To overcome this problem SCHED_LOAD_SCALE has been replaced by the load_weight for the relevant task or by the average load_weight per task for the queue in question (as appropriate).

int move_tasks():

The modifications to this function were complicated by the fact that active_load_balance() uses it to move exactly one task without checking whether an imbalance actually exists. This precluded the simple overloading of max_nr_move with max_load_move and necessitated the addition of the latter as an extra argument to the function. The internal implementation is then modified to move up to max_nr_move tasks and max_load_move of weighted load. This slightly complicates the code where move_tasks() is called and if ever active_load_balance() is changed to not use move_tasks() the implementation of move_tasks() should be simplified accordingly.

struct sched_group *find_busiest_group():

Similar to try_to_wake_up(), there are places in this function where SCHED_LOAD_SCALE is used to represent the load contribution of a single task and the same issues are created. A similar solution is adopted except that it is now the average per task contribution to a group's load (as opposed to a run queue) that is required. As this value is not directly available from the group it is calculated on the fly as the queues in the groups are visited when determining the busiest group.

A key change to this function is that it is no longer to scale down *imbalance on exit as move_tasks() uses the load in its scaled form.

void set_user_nice():

has been modified to update the task's load_weight field when it's nice value and also to ensure that its run queue's raw_weighted_load field is updated if it was runnable.

 include/linux/sched.h |    3
 kernel/sched.c        |  230 ++++++++++++++++++++++++++++++++----------
 2 files changed, 183 insertions(+), 50 deletions(-)

Thanks to Con Kolivas for his contributions.
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: GIT-warnings/include/linux/sched.h
===================================================================
@@ -701,6 +701,9 @@ struct task_struct {
 	int oncpu;
 #endif
 	int prio, static_prio;
+#ifdef CONFIG_SMP
+	int load_weight;	/* for load balancing purposes */
+#endif
 	struct list_head run_list;
 	prio_array_t *array;
 
kernel/sched.c +180 -50

487 lines not on this page · raw message

#1 lore raw

On Monday 20 February 2006 16:02, Peter Williams wrote:
[snip description]

Hi peter, I've had a good look and have just a couple of comments:

---

 #endif
        int prio, static_prio;

+#ifdef CONFIG_SMP
+ int load_weight; /* for load balancing purposes */
+#endif
---

Can this be moved up to be part of the other ifdef CONFIG_SMP? Not highly significant since it's in a .h file but looks a tiny bit nicer.

---
+/*
+ * Priority weight for load balancing ranges from 1/20 (nice==19) to 459/20 (RT
+ * priority of 100).
+ */
+#define NICE_TO_LOAD_PRIO(nice) \
+ ((nice >= 0) ? (20 - (nice)) : (20 + (nice) * (nice)))
+#define LOAD_WEIGHT(lp) \
+ (((lp) * SCHED_LOAD_SCALE) / NICE_TO_LOAD_PRIO(0))
+#define NICE_TO_LOAD_WEIGHT(nice) LOAD_WEIGHT(NICE_TO_LOAD_PRIO(nice))
+#define PRIO_TO_LOAD_WEIGHT(prio) NICE_TO_LOAD_WEIGHT(PRIO_TO_NICE(prio))
+#define RTPRIO_TO_LOAD_WEIGHT(rp) \
+ LOAD_WEIGHT(NICE_TO_LOAD_PRIO(-20) + (rp))
---

The weighting seems not related to anything in particular apart from saying that -nice values are more heavily weighted. Since you only do this when setting the priority of tasks can you link it to the scale of (SCHED_NORMAL) tasks' timeslice instead even though that will take a fraction more calculation? RTPRIO_TO_LOAD_WEIGHT is fine since there isn't any obvious cpu proportion relationship to rt_prio level.

Otherwise, good work, thanks!

Quoted 1 line

Cheers,
Con

#2 lore raw
Quoted 13 lines · Con Kolivas

On Monday 20 February 2006 16:02, Peter Williams wrote:
[snip description]

Hi peter, I've had a good look and have just a couple of comments:

---

 #endif
        int prio, static_prio;
include/linux/sched.h +3 -1
+#ifdef CONFIG_SMP
+       int load_weight;        /* for load balancing purposes */
+#endif
---
Quoted 1 line

Can this be moved up to be part of the other ifdef CONFIG_SMP? Not highly significant since it's in a .h file but looks a tiny bit nicer.

I originally put it where it is to be near prio and static_prio which are referenced at the same time as it BUT that doesn't happen often enough to justify it anymore so I guess it can be moved.

Quoted 18 lines

---
+/*
+ * Priority weight for load balancing ranges from 1/20 (nice==19) to 459/20 (RT
+ * priority of 100).
+ */

kernel/sched.c +6 -0
+#define NICE_TO_LOAD_PRIO(nice) \
+       ((nice >= 0) ? (20 - (nice)) : (20 + (nice) * (nice)))
+#define LOAD_WEIGHT(lp) \
+       (((lp) * SCHED_LOAD_SCALE) / NICE_TO_LOAD_PRIO(0))
+#define NICE_TO_LOAD_WEIGHT(nice)      LOAD_WEIGHT(NICE_TO_LOAD_PRIO(nice))
+#define PRIO_TO_LOAD_WEIGHT(prio)      

NICE_TO_LOAD_WEIGHT(PRIO_TO_NICE(prio))

kernel/sched.c +2 -1
+#define RTPRIO_TO_LOAD_WEIGHT(rp) \
+       LOAD_WEIGHT(NICE_TO_LOAD_PRIO(-20) + (rp))
---
Quoted 1 line

The weighting seems not related to anything in particular apart from saying that -nice values are more heavily weighted.

The idea (for the change from the earlier model) was to actually give equal weight to negative and positive nices. Under the old (purely linear) model a nice=19 task has 1/20th the weight of a nice==0 task but a nice==-20 task only has twice the weight of a nice==0 so that system is heavily weighted against negative nices. With this new mapping a nice=19 has 1/20th and a nice==-19 has 20 times the weight of a nice==0 task and to me that is symmetric. Does that make sense to you?

Should I add a comment to explain the mapping?

Quoted 1 line

Since you only do this when setting the priority of tasks can you link it to the scale of (SCHED_NORMAL) tasks' timeslice instead even though that will take a fraction more calculation? RTPRIO_TO_LOAD_WEIGHT is fine since there isn't any obvious cpu proportion relationship to rt_prio level.

Interesting idea. I'll look at this more closely.

Quoted 10 lines

Otherwise, good work, thanks!

Quoted 1 line

Cheers,
Con

Peter

Signature · 4 lines
Peter Williams                                   [email protected]

"Learning, n. The kind of ignorance distinguishing the studious."
 -- Ambrose Bierce
#3 lore raw
Quoted 14 lines · Peter Williams
Quoted 13 lines · Con Kolivas

On Monday 20 February 2006 16:02, Peter Williams wrote:
[snip description]

Hi peter, I've had a good look and have just a couple of comments:

---

 #endif
        int prio, static_prio;
include/linux/sched.h +3 -1
+#ifdef CONFIG_SMP
+       int load_weight;        /* for load balancing purposes */
+#endif
---
Quoted 6 lines
Quoted 2 lines

Can this be moved up to be part of the other ifdef CONFIG_SMP? Not highly significant since it's in a .h file but looks a tiny bit nicer.

I originally put it where it is to be near prio and static_prio which are referenced at the same time as it BUT that doesn't happen often enough to justify it anymore so I guess it can be moved.

Well it is just before prio instead of just after it now and I understand the legacy of the position.

Quoted 17 lines
Quoted 17 lines

---
+/*
+ * Priority weight for load balancing ranges from 1/20 (nice==19) to 459/20 (RT
+ * priority of 100).
+ */

kernel/sched.c +5 -0
+#define NICE_TO_LOAD_PRIO(nice) \
+       ((nice >= 0) ? (20 - (nice)) : (20 + (nice) * (nice)))
+#define LOAD_WEIGHT(lp) \
+       (((lp) * SCHED_LOAD_SCALE) / NICE_TO_LOAD_PRIO(0))
+#define NICE_TO_LOAD_WEIGHT(nice)     

LOAD_WEIGHT(NICE_TO_LOAD_PRIO(nice)) +#define PRIO_TO_LOAD_WEIGHT(prio) NICE_TO_LOAD_WEIGHT(PRIO_TO_NICE(prio))

kernel/sched.c +2 -1
+#define RTPRIO_TO_LOAD_WEIGHT(rp) \
+       LOAD_WEIGHT(NICE_TO_LOAD_PRIO(-20) + (rp))
---
Quoted 10 lines
Quoted 2 lines

The weighting seems not related to anything in particular apart from saying that -nice values are more heavily weighted.

The idea (for the change from the earlier model) was to actually give equal weight to negative and positive nices. Under the old (purely linear) model a nice=19 task has 1/20th the weight of a nice==0 task but a nice==-20 task only has twice the weight of a nice==0 so that system is heavily weighted against negative nices. With this new mapping a nice=19 has 1/20th and a nice==-19 has 20 times the weight of a nice==0 task and to me that is symmetric. Does that make sense to you?

Yes but what I meant is it's still an arbitrary algorithm which is why I suggested proportional to tasks' timeslice because then it should scale with the theoretically allocated cpu resource.

Quoted 9 lines

Should I add a comment to explain the mapping?

Quoted 5 lines

Since you only do this when
setting the priority of tasks can you link it to the scale of (SCHED_NORMAL) tasks' timeslice instead even though that will take a fraction more calculation? RTPRIO_TO_LOAD_WEIGHT is fine since there isn't any obvious cpu proportion relationship to rt_prio level.

Interesting idea. I'll look at this more closely.

Would be just a matter of using task_timeslice(p) and making it proportional to some baseline ensuring the baseline works at any HZ.

Cheers,
Con

#4 lore raw
Quoted 69 lines · Con Kolivas
Quoted 15 lines · Peter Williams
Quoted 13 lines · Con Kolivas

On Monday 20 February 2006 16:02, Peter Williams wrote:
[snip description]

Hi peter, I've had a good look and have just a couple of comments:

---

#endif
       int prio, static_prio;
(quoted diff) +3 -1
+#ifdef CONFIG_SMP
+       int load_weight;        /* for load balancing purposes */
+#endif
---
Quoted 6 lines
Quoted 2 lines

Can this be moved up to be part of the other ifdef CONFIG_SMP? Not highly significant since it's in a .h file but looks a tiny bit nicer.

I originally put it where it is to be near prio and static_prio which are referenced at the same time as it BUT that doesn't happen often enough to justify it anymore so I guess it can be moved.

Well it is just before prio instead of just after it now and I understand the legacy of the position.

Quoted 17 lines
Quoted 17 lines

---
+/*
+ * Priority weight for load balancing ranges from 1/20 (nice==19) to 459/20 (RT
+ * priority of 100).
+ */

(quoted diff) +5 -0
+#define NICE_TO_LOAD_PRIO(nice) \
+       ((nice >= 0) ? (20 - (nice)) : (20 + (nice) * (nice)))
+#define LOAD_WEIGHT(lp) \
+       (((lp) * SCHED_LOAD_SCALE) / NICE_TO_LOAD_PRIO(0))
+#define NICE_TO_LOAD_WEIGHT(nice)     

LOAD_WEIGHT(NICE_TO_LOAD_PRIO(nice)) +#define PRIO_TO_LOAD_WEIGHT(prio) NICE_TO_LOAD_WEIGHT(PRIO_TO_NICE(prio))

(quoted diff) +2 -1
+#define RTPRIO_TO_LOAD_WEIGHT(rp) \
+       LOAD_WEIGHT(NICE_TO_LOAD_PRIO(-20) + (rp))
---
Quoted 10 lines
Quoted 2 lines

The weighting seems not related to anything in particular apart from saying that -nice values are more heavily weighted.

The idea (for the change from the earlier model) was to actually give equal weight to negative and positive nices. Under the old (purely linear) model a nice=19 task has 1/20th the weight of a nice==0 task but a nice==-20 task only has twice the weight of a nice==0 so that system is heavily weighted against negative nices. With this new mapping a nice=19 has 1/20th and a nice==-19 has 20 times the weight of a nice==0 task and to me that is symmetric. Does that make sense to you?

Yes but what I meant is it's still an arbitrary algorithm which is why I suggested proportional to tasks' timeslice because then it should scale with the theoretically allocated cpu resource.

Quoted 9 lines

Should I add a comment to explain the mapping?

Quoted 5 lines

Since you only do this when
setting the priority of tasks can you link it to the scale of (SCHED_NORMAL) tasks' timeslice instead even though that will take a fraction more calculation? RTPRIO_TO_LOAD_WEIGHT is fine since there isn't any obvious cpu proportion relationship to rt_prio level.

Quoted 4 lines
Quoted 1 line

Interesting idea. I'll look at this more closely.

Would be just a matter of using task_timeslice(p) and making it proportional to some baseline ensuring the baseline works at any HZ.

How does the attached patch grab you? It's independent of HZ.

Peter

Signature · 4 lines
Peter Williams                                   [email protected]

"Learning, n. The kind of ignorance distinguishing the studious."
 -- Ambrose Bierce
kernel/sched.c +6 -8
Index: MM-2.6.X/kernel/sched.c
===================================================================
@@ -169,13 +169,13 @@
 
 #define SCALE_PRIO(x, prio) \
 	max(x * (MAX_PRIO - prio) / (MAX_USER_PRIO/2), MIN_TIMESLICE)
+#define PRIO_TO_TS(sp) \
+	((sp) < NICE_TO_PRIO(0) ? SCALE_PRIO(DEF_TIMESLICE*4, (sp)) : \
+	 SCALE_PRIO(DEF_TIMESLICE, (sp)))
 
 static unsigned int task_timeslice(task_t *p)
 {
-	if (p->static_prio < NICE_TO_PRIO(0))
-		return SCALE_PRIO(DEF_TIMESLICE*4, p->static_prio);
-	else
-		return SCALE_PRIO(DEF_TIMESLICE, p->static_prio);
+	return PRIO_TO_TS(p->static_prio);
 }
 #define task_hot(p, now, sd) ((long long) ((now) - (p)->last_ran)	\
 				< (long long) (sd)->cache_hot_time)
@@ -680,11 +680,9 @@ static int effective_prio(task_t *p)
  */
 
 /*
- * Priority weight for load balancing ranges from 1/20 (nice==19) to 459/20 (RT
- * priority of 100).
+ * Priority weight for load balancing ranges (based on time slice allocations).
  */
-#define NICE_TO_LOAD_PRIO(nice) \
-	((nice >= 0) ? (20 - (nice)) : (20 + (nice) * (nice)))
+#define NICE_TO_LOAD_PRIO(nice) 	PRIO_TO_TS(NICE_TO_PRIO(nice))
 #define LOAD_WEIGHT(lp) \
 	(((lp) * SCHED_LOAD_SCALE) / NICE_TO_LOAD_PRIO(0))
 #define NICE_TO_LOAD_WEIGHT(nice)	LOAD_WEIGHT(NICE_TO_LOAD_PRIO(nice))
#5 lore raw
Quoted 5 lines · Peter Williams
Quoted 2 lines · Con Kolivas

Would be just a matter of using task_timeslice(p) and making it proportional to some baseline ensuring the baseline works at any HZ.

How does the attached patch grab you? It's independent of HZ.

Looks good thanks.

Cheers,
Con

#6 lore raw
Quoted 4 lines · Con Kolivas
Quoted 2 lines · Peter Williams

Con Kolivas wrote:

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Would be just a matter of using task_timeslice(p) and making it proportional to some baseline ensuring the baseline works at any HZ.

How does the attached patch grab you? It's independent of HZ.

Looks good thanks.

I think that there's a way that we can leverage this to make task_timeslice() more efficient by calculating it in terms of the task's load_weight. I.e. if the value of load_weight is established based on the current time slice formula then it will be a simple mapping (basically, just a scaling) from load_weight to time slice. Scaling is at most a multiply and a divide where the current cost of task_timeslice() is 2 comparisons, a subtraction, a multiply and a divide (after you take account of the multiplies and divides that the compiler would do at compile time).

Attached is a patch for comment.

NB I had to add an extra comparison in sched_timeslice() to maintain the relationship between "nice" and time slice allocations to RT tasks. I don't know whether this relationship is deliberate (as there are comments in set_user_nice() to the effect that static_prio is just updated for RT tasks in case they become non RT tasks and has no effect on scheduling). If it's not and higher time slice allocations for RT tasks would be acceptable (only really matters for SCHED_RR except for where task_timeslice() is used in sched_exit() and dependent_sleeper()) then this could be simplified.

Comments, Please?

Peter

Signature · 4 lines
Peter Williams                                   [email protected]

"Learning, n. The kind of ignorance distinguishing the studious."
 -- Ambrose Bierce
kernel/sched.c +39 -18
Index: MM-2.6.X/kernel/sched.c
===================================================================
@@ -170,13 +170,30 @@
 #define SCALE_PRIO(x, prio) \
 	max(x * (MAX_PRIO - prio) / (MAX_USER_PRIO/2), MIN_TIMESLICE)
 
-static unsigned int task_timeslice(task_t *p)
+static unsigned int static_prio_timeslice(int static_prio)
 {
-	if (p->static_prio < NICE_TO_PRIO(0))
-		return SCALE_PRIO(DEF_TIMESLICE*4, p->static_prio);
+	if (static_prio < NICE_TO_PRIO(0))
+		return SCALE_PRIO(DEF_TIMESLICE*4, static_prio);
 	else
-		return SCALE_PRIO(DEF_TIMESLICE, p->static_prio);
+		return SCALE_PRIO(DEF_TIMESLICE, static_prio);
 }
+
+static inline unsigned int task_timeslice(task_t *p)
+{
+	/*
+	 * This is needed in order to maintain the relationship between
+	 * "nice" and time slice allocations for SCHED_RR and SCHED_FIFO tasks
+	 */
+	if (rt_task(p))
+		return static_prio_timeslice(p->static_prio);
+#ifdef CONFIG_SMP
+	/* load_weight is a scaled version of the time slice allocation */
+	return p->load_weight * DEF_TIMESLICE / SCHED_LOAD_SCALE;
+#else
+	return p->load_weight;
+#endif
+}
+
 #define task_hot(p, now, sd) ((long long) ((now) - (p)->last_ran)	\
 				< (long long) (sd)->cache_hot_time)
 
@@ -671,30 +688,36 @@ static int effective_prio(task_t *p)
 	return prio;
 }
 
-#ifdef CONFIG_SMP
 /*
  * 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.
+ * 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.
  */
 
 /*
- * Priority weight for load balancing ranges from 1/20 (nice==19) to 459/20 (RT
- * priority of 100).
+ * Assume: static_prio_timeslice(NICE_TO_PRIO(0)) == DEF_TIMESLICE
+ * If static_prio_timeslice() is ever changed to break this assumption then
+ * this code will need modification
  */
-#define NICE_TO_LOAD_PRIO(nice) \
-	((nice >= 0) ? (20 - (nice)) : (20 + (nice) * (nice)))
+#define TIME_SLICE_NICE_ZERO DEF_TIMESLICE
+#ifdef CONFIG_SMP
 #define LOAD_WEIGHT(lp) \
-	(((lp) * SCHED_LOAD_SCALE) / NICE_TO_LOAD_PRIO(0))
-#define NICE_TO_LOAD_WEIGHT(nice)	LOAD_WEIGHT(NICE_TO_LOAD_PRIO(nice))
-#define PRIO_TO_LOAD_WEIGHT(prio)	NICE_TO_LOAD_WEIGHT(PRIO_TO_NICE(prio))
+	(((lp) * SCHED_LOAD_SCALE) / TIME_SLICE_NICE_ZERO)
+#else
+#define LOAD_WEIGHT(lp) (lp)
+#endif
+#define PRIO_TO_LOAD_WEIGHT(prio) \
+	LOAD_WEIGHT(static_prio_timeslice(prio))
 #define RTPRIO_TO_LOAD_WEIGHT(rp) \
-	LOAD_WEIGHT(NICE_TO_LOAD_PRIO(-20) + (rp))
+	(PRIO_TO_LOAD_WEIGHT(MAX_RT_PRIO) + LOAD_WEIGHT(rp))
 
 static inline void set_load_weight(task_t *p)
 {
 	if (rt_task(p)) {
+#ifdef CONFIG_SMP
 		if (p == task_rq(p)->migration_thread)
 			/*
 			 * The migration thread does the actual balancing.
@@ -703,11 +726,13 @@ static inline void set_load_weight(task_
 			 */
 			p->load_weight = 0;
 		else
+#endif
 			p->load_weight = RTPRIO_TO_LOAD_WEIGHT(p->rt_priority);
 	} else
 		p->load_weight = PRIO_TO_LOAD_WEIGHT(p->static_prio);
 }
 
+#ifdef CONFIG_SMP
 static inline void inc_raw_weighted_load(runqueue_t *rq, const task_t *p)
 {
 	rq->raw_weighted_load += p->load_weight;
@@ -718,10 +743,6 @@ static inline void dec_raw_weighted_load
 	rq->raw_weighted_load -= p->load_weight;
 }
 #else
-static inline void set_load_weight(task_t *p)
-{
-}
-
 static inline void inc_raw_weighted_load(runqueue_t *rq, const task_t *p)
 {
 }
include/linux/sched.h +2 -3
Index: MM-2.6.X/include/linux/sched.h
===================================================================
@@ -703,9 +703,8 @@ struct task_struct {
 	int oncpu;
 #endif
 	int prio, static_prio;
-#ifdef CONFIG_SMP
-	int load_weight;	/* for load balancing purposes */
-#endif
+	int load_weight;	/* used for load balancing and time slice allocation  */
+
 	struct list_head run_list;
 	prio_array_t *array;