[PATCH][2.5] Don't schedule tasks on offline cpus

Zwane Mwaikambo (zwane@holomorphy.com)
Mon, 17 Feb 2003 03:12:22 -0500 (EST)


We don't want to allow a cpu going offline to keep doing scheduler work so
let it exit early, otherwise we'd keep pulling in tasks every timer tick.

diff -u -r1.1.1.1 sched.c
--- linux-2.5.61-trojan/kernel/sched.c 15 Feb 2003 12:32:44 -0000 1.1.1.1
+++ linux-2.5.61-trojan/kernel/sched.c 15 Feb 2003 16:04:51 -0000
@@ -939,6 +948,11 @@
struct list_head *head, *curr;
task_t *tmp;

+ /* CPU going down is a special case: we don't pull more tasks
+ onboard */
+ if (unlikely(!cpu_online(this_cpu)))
+ goto out;
+
busiest = find_busiest_queue(this_rq, this_cpu, idle, &imbalance,
cpus_to_balance(this_cpu, this_rq));
if (!busiest)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/