+ sched-avoid-unnecessarily-moving-highest-priority-task-move_tasks-fix-2.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     sched: fix evaluation of skip_for_load in move_tasks()

has been added to the -mm tree.  Its filename is

     sched-avoid-unnecessarily-moving-highest-priority-task-move_tasks-fix-2.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this


From: Peter Williams <pwil3058@xxxxxxxxxxxxxx>

Problem:

In the patch
sched-avoid-unnecessarily-moving-highest-priority-task-move_tasks.patch I
got a the sense of a boolean expression wrong when assigning a value to
skip_for_load.  The expression should have been negated before being
assigned.

Additionally, busiest_best_prio_seen is being set when tasks are moved
instead of when they are skipped which will cause problems when the current
task does not have prio=busiest_best_prio.

Solution:

Negate the expression and apply de Marcos rule to simplify it and move the
setting of busiest_best_prio_seen.

Signed-off-by: Peter Williams <pwil3058@xxxxxxxxxxxxxx>
Cc: "Siddha, Suresh B" <suresh.b.siddha@xxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

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

diff -puN kernel/sched.c~sched-avoid-unnecessarily-moving-highest-priority-task-move_tasks-fix-2 kernel/sched.c
--- devel/kernel/sched.c~sched-avoid-unnecessarily-moving-highest-priority-task-move_tasks-fix-2	2006-04-24 20:38:20.000000000 -0700
+++ devel-akpm/kernel/sched.c	2006-04-24 20:38:20.000000000 -0700
@@ -2010,7 +2010,10 @@ static int move_tasks(runqueue_t *this_r
 	busiest_best_prio = rq_best_prio(busiest);
 	/*
 	 * Enable handling of the case where there is more than one task
-	 * with the best priority.
+	 * with the best priority.   If the current running task is one
+	 * of those with prio==busiest_best_prio we know it won't be moved
+	 * and therefore it's safe to override the skip (based on load) of
+	 * any task we find with that prio.
 	 */
 	busiest_best_prio_seen = busiest_best_prio == busiest->curr->prio;
 
@@ -2059,9 +2062,10 @@ skip_queue:
 	 */
 	skip_for_load = tmp->load_weight > rem_load_move;
 	if (skip_for_load && idx < this_best_prio)
-		skip_for_load = busiest_best_prio_seen || idx != busiest_best_prio;
+		skip_for_load = !busiest_best_prio_seen && idx == busiest_best_prio;
 	if (skip_for_load ||
 	    !can_migrate_task(tmp, busiest, this_cpu, sd, idle, &pinned)) {
+		busiest_best_prio_seen |= idx == busiest_best_prio;
 		if (curr != head)
 			goto skip_queue;
 		idx++;
@@ -2084,8 +2088,6 @@ skip_queue:
 	if (pulled < max_nr_move && rem_load_move > 0) {
 		if (idx < this_best_prio)
 			this_best_prio = idx;
-		if (idx == busiest_best_prio)
-			busiest_best_prio_seen = 1;
 		if (curr != head)
 			goto skip_queue;
 		idx++;
_

Patches currently in -mm which might be from pwil3058@xxxxxxxxxxxxxx are

sched-implement-smpnice.patch
sched-protect-calculation-of-max_pull-from-integer-wrap.patch
sched-store-weighted-load-on-up.patch
sched-prevent-high-load-weight-tasks-suppressing-balancing.patch
sched-improve-stability-of-smpnice-load-balancing.patch
sched-improve-smpnice-load-balancing-when-load-per-task.patch
sched-modify-move_tasks-to-improve-load-balancing-outcomes.patch
sched-avoid-unnecessarily-moving-highest-priority-task-move_tasks.patch
sched-avoid-unnecessarily-moving-highest-priority-task-move_tasks-fix-2.patch
sched-add-above-background-load-function.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux