linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Martin J. Bligh" <Martin.Bligh@us.ibm.com>
To: mingo@elte.hu
Cc: linux-kernel@vger.kernel.org
Subject: Ingo's O(1) scheduler vs. wait_init_idle
Date: Wed, 23 Jan 2002 17:43:43 -0800	[thread overview]
Message-ID: <119440000.1011836623@flay> (raw)
In-Reply-To: <Pine.LNX.4.33.0201211626030.12418-100000@localhost.localdomain>
In-Reply-To: <Pine.LNX.4.33.0201211626030.12418-100000@localhost.localdomain>

> and due to popular demand there is also a patch against 2.4.18-pre4:
> 
>    http://redhat.com/~mingo/O(1)-scheduler/sched-O1-2.4.18-pre4-J4.patch

I was trying to test this in my 8 way NUMA box, but this patch
seems to have lost half of the wait_init_idle fix that I put
in a while back. I'm not sure if this is deliberate or not, but
I suspect not, as you only removed part of it, and from your 
comment below (from a previous email), I think you understand 
the reasoning behind it:

> the new rules are this: no schedule() must be called before all bits in
> wait_init_idle are clear. I'd suggest for you to add this to the top of
> schedule():
>
>	if (wait_init_idle)
>		BUG();

Anyway, the machine won't boot without this fix, so I tried adding
it back in, and now it boots just fine. Patch is attached below.

If the removal was accidental, please could you add it back in 
as below ... if not, could we discuss why this was removed, and
maybe we can find another way to fix the problem?

Meanwhile, I'll try to knock out some benchmark figures with the
new scheduler code in place on the 8 way NUMA and a 16 way
NUMA ;-)

Martin.



diff -urN linux-2.4.18-pre4.old/init/main.c linux-2.4.18-pre4.new/init/main.c
--- linux-2.4.18-pre4.old/init/main.c	Wed Jan 23 18:26:56 2002
+++ linux-2.4.18-pre4.new/init/main.c	Wed Jan 23 18:27:04 2002
@@ -508,6 +508,14 @@
 
 	smp_threads_ready=1;
 	smp_commence();
+
+	/* Wait for the other cpus to set up their idle processes */
+	printk("Waiting on wait_init_idle (map = 0x%lx)\n", wait_init_idle);
+	while (wait_init_idle) {
+		cpu_relax();
+		barrier();
+	}
+	printk("All processors have done init_idle\n");
 }
 
 #endif
diff -urN linux-2.4.18-pre4.old/kernel/sched.c linux-2.4.18-pre4.new/kernel/sched.c
--- linux-2.4.18-pre4.old/kernel/sched.c	Wed Jan 23 18:26:56 2002
+++ linux-2.4.18-pre4.new/kernel/sched.c	Wed Jan 23 18:27:09 2002
@@ -1221,6 +1221,8 @@
 		spin_unlock(&rq2->lock);
 }
 
+extern unsigned long wait_init_idle;
+
 void __init init_idle(void)
 {
 	runqueue_t *this_rq = this_rq(), *rq = current->array->rq;
@@ -1237,6 +1239,7 @@
 	current->state = TASK_RUNNING;
 	double_rq_unlock(this_rq, rq);
 	current->need_resched = 1;
+	clear_bit(cpu(), &wait_init_idle);
 	__restore_flags(flags);
 }
 


  reply	other threads:[~2002-01-24  1:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-21 15:05 [patch] O(1) scheduler, -J4 Ingo Molnar
2002-01-21 15:32 ` [patch] O(1) scheduler, -J4, 2.4.18-pre4 Ingo Molnar
2002-01-24  1:43   ` Martin J. Bligh [this message]
2002-01-24  9:21     ` Ingo's O(1) scheduler vs. wait_init_idle Ingo Molnar
2002-01-24 17:47       ` Martin J. Bligh
2002-01-24 19:59         ` Ingo Molnar
2002-01-26 17:19         ` Jesse Barnes
2002-02-07 13:08     ` Performance of Ingo's O(1) scheduler on NUMA-Q Martin J. Bligh
2002-02-07 23:23       ` Ingo Molnar
2002-02-08 15:15         ` Daniel Egger
2002-02-11 17:39         ` Martin J. Bligh
2002-01-25 23:07   ` Performance of Ingo's O(1) scheduler on 8 way NUMA-Q Martin J. Bligh

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=119440000.1011836623@flay \
    --to=martin.bligh@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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;
as well as URLs for NNTP newsgroup(s).