mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: jak@rudolph.ccur.com (Joe Korty)
To: marcelo@conectiva.com.br
Cc: mingo@elte.hu, alan@lxorguk.ukuu.org.uk, torvalds@transmeta.com,
	linux-kernel@vger.kernel.org
Subject: [PATCH] 2.4.18 scheduler bugs
Date: Fri, 15 Mar 2002 15:54:39 -0500 (EST)	[thread overview]
Message-ID: <200203152054.UAA27581@rudolph.ccur.com> (raw)

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 */


             reply	other threads:[~2002-03-15 20:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-15 20:54 Joe Korty [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200203152054.UAA27581@rudolph.ccur.com \
    --to=jak@rudolph.ccur.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=joe.korty@ccur.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    --cc=mingo@elte.hu \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®