[PATCH 1/2] sched: remove extraneous load manipulations

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <stable@...>, <linux-rt-users@...>, <rostedt@...>, <mingo@...>
Cc: <peterz@...>, <ghaskins@...>, <linux-kernel@...>
Date: Thursday, July 3, 2008 - 5:37 pm

commit 62fb185130e4d420f71a30ff59d8b16b74ef5d2b reverted some patches
in the scheduler, but it looks like it may have left a few redundant
calls to inc_load/dec_load remain in set_user_nice (since the
 dequeue_task/enqueue_task take care of the load.  This could result
in the load values being off since the load may change while dequeued.

Signed-off-by: Gregory Haskins <ghaskins@novell.com>
CC: Peter Zijlstra <peterz@infradead.org>
CC: Ingo Molnar <mingo@elte.hu>
---

 kernel/sched.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index 31f91d9..b046754 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4679,10 +4679,8 @@ void set_user_nice(struct task_struct *p, long nice)
 		goto out_unlock;
 	}
 	on_rq = p->se.on_rq;
-	if (on_rq) {
+	if (on_rq)
 		dequeue_task(rq, p, 0);
-		dec_load(rq, p);
-	}
 
 	p->static_prio = NICE_TO_PRIO(nice);
 	set_load_weight(p);
@@ -4692,7 +4690,7 @@ void set_user_nice(struct task_struct *p, long nice)
 
 	if (on_rq) {
 		enqueue_task(rq, p, 0);
-		inc_load(rq, p);
+
 		/*
 		 * If the task increased its priority or is running and
 		 * lowered its priority, then reschedule its CPU:

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/2] sched: misc fixes for stable-25.y and 25-rt, Gregory Haskins, (Thu Jul 3, 5:37 pm)
[PATCH 1/2] sched: remove extraneous load manipulations, Gregory Haskins, (Thu Jul 3, 5:37 pm)
Re: [PATCH 1/2] sched: remove extraneous load manipulations, Gregory Haskins, (Mon Jul 21, 6:06 pm)
Re: [PATCH 1/2] sched: remove extraneous load manipulations, Gregory Haskins, (Fri Jul 18, 8:53 am)