[PATCH 3/7] RT: Only consider online CPUs when pushing rt tasks

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Gregory Haskins
Date: Thursday, October 11, 2007 - 2:59 pm

task->cpus_allowed can have bit positions that are set for CPUs that are
not currently online.  So we optimze our search by ANDing against the online
set.

Signed-off-by: Gregory Haskins <ghaskins@novell.com>
---

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

diff --git a/kernel/sched.c b/kernel/sched.c
index 24b38b4..0ca3905 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1510,10 +1510,14 @@ static int push_rt_task(struct rq *this_rq)
 
 	/* Only try this algorithm three times */
 	for (tries = 0; tries < 3; tries++) {
+		cpumask_t mask;
+
+		cpus_and(mask, cpu_online_map, next_task->cpus_allowed);
+
 		/*
 		 * Scan each rq for the lowest prio.
 		 */
-		for_each_cpu_mask(cpu, next_task->cpus_allowed) {
+		for_each_cpu_mask(cpu, mask) {
 			struct rq *rq = &per_cpu(runqueues, cpu);
 
 			if (cpu == smp_processor_id())

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

Messages in current thread:
[PATCH 0/7] RT: (RFC) RT-Overload/Sched enhancements , Gregory Haskins, (Thu Oct 11, 2:59 pm)
[PATCH 1/7] RT: Push waiting rt tasks, Gregory Haskins, (Thu Oct 11, 2:59 pm)
[PATCH 3/7] RT: Only consider online CPUs when pushing rt ..., Gregory Haskins, (Thu Oct 11, 2:59 pm)
[PATCH 4/7] RT: Add a per-cpu rt_overload indication, Gregory Haskins, (Thu Oct 11, 3:00 pm)
[PATCH 5/7] RT: CPU priority management, Gregory Haskins, (Thu Oct 11, 3:00 pm)
[PATCH 7/7] RT: push-rt enhancements, Gregory Haskins, (Thu Oct 11, 3:00 pm)
Re: [PATCH 0/7] RT: (RFC) RT-Overload/Sched enhancements, Peter Zijlstra, (Fri Oct 12, 3:29 am)
Re: [PATCH 0/7] RT: (RFC) RT-Overload/Sched enhancements, Steven Rostedt, (Fri Oct 12, 4:47 am)
Re: [PATCH 0/7] RT: (RFC) RT-Overload/Sched enhancements, Gregory Haskins, (Fri Oct 12, 6:20 am)
Re: [PATCH 0/7] RT: (RFC) RT-Overload/Sched enhancements, Gregory Haskins, (Fri Oct 12, 7:05 am)