mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] 2.4.18 scheduler bugs
@ 2002-03-15 20:54 Joe Korty
  2002-03-15 19:55 ` Ingo Molnar
  2002-03-15 21:39 ` Alan Cox
  0 siblings, 2 replies; 14+ messages in thread
From: Joe Korty @ 2002-03-15 20:54 UTC (permalink / raw)
  To: marcelo; +Cc: mingo, alan, torvalds, linux-kernel

Hi Marcelo et all,
 The following fixes some rather straightforward bugs in the old
(pre-O(1)) scheduler that I discovered while exercising it with
custom instrumentation written in.  These may be worth fixing, given
that it may be a long time before the new O(1) scheduler officially
shows up in a production tree.

Joe

- ksoftirqd() - change daemon nice(2) value from 19 to -19.

    SoftIRQ servicing was less important than the most lowly of batch
    tasks.  This patch makes it more important than all but the realtime
    tasks.

- reschedule_idle() - smp_send_reschedule when setting idle's need_resched

    Idle tasks nowdays don't spin waiting for need->resched to change,
    they sleep on a halt insn instead.  Therefore any setting of
    need->resched on an idle task running on a remote CPU should be
    accompanied by a cross-processor interrupt.

diff -Nur linux-2.4.18-base/kernel/sched.c linux/kernel/sched.c
--- linux-2.4.18-base/kernel/sched.c	Fri Dec 21 12:42:04 2001
+++ linux/kernel/sched.c	Fri Mar 15 14:57:21 2002
@@ -225,16 +225,9 @@
 	if (can_schedule(p, best_cpu)) {
 		tsk = idle_task(best_cpu);
 		if (cpu_curr(best_cpu) == tsk) {
-			int need_resched;
 send_now_idle:
-			/*
-			 * If need_resched == -1 then we can skip sending
-			 * the IPI altogether, tsk->need_resched is
-			 * actively watched by the idle thread.
-			 */
-			need_resched = tsk->need_resched;
 			tsk->need_resched = 1;
-			if ((best_cpu != this_cpu) && !need_resched)
+			if (best_cpu != this_cpu)
 				smp_send_reschedule(best_cpu);
 			return;
 		}
diff -Nur linux-2.4.18-base/kernel/softirq.c linux/kernel/softirq.c
--- linux-2.4.18-base/kernel/softirq.c	Wed Oct 31 13:26:02 2001
+++ linux/kernel/softirq.c	Fri Mar 15 14:55:38 2002
@@ -365,7 +365,7 @@
 	int cpu = cpu_logical_map(bind_cpu);
 
 	daemonize();
-	current->nice = 19;
+	current->nice = -19;
 	sigfillset(&current->blocked);
 
 	/* Migrate to the right CPU */


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2002-03-19  2:08 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-15 20:54 [PATCH] 2.4.18 scheduler bugs Joe Korty
2002-03-15 19:55 ` Ingo Molnar
2002-03-15 21:25   ` Joe Korty
2002-03-15 20:35     ` Ingo Molnar
2002-03-15 21:58       ` Alan Cox
2002-03-15 20:42         ` Ingo Molnar
2002-03-15 21:59           ` Joe Korty
2002-03-15 20:57             ` Ingo Molnar
2002-03-15 22:14               ` Joe Korty
2002-03-15 23:50                 ` Mike Kravetz
2002-03-16  9:23                 ` Ingo Molnar
2002-03-15 21:39 ` Alan Cox
2002-03-15 21:26   ` Joe Korty
2002-03-19  2:08   ` Rob Landley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®