All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Love <rml@tech9.net>
To: dipankar@in.ibm.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.5.8: preemption + SMP broken ?
Date: 17 Apr 2002 14:25:57 -0400	[thread overview]
Message-ID: <1019067957.1669.46.camel@phantasy> (raw)
In-Reply-To: <20020417232253.A629@in.ibm.com>

On Wed, 2002-04-17 at 13:52, Dipankar Sarma wrote:
> My machine (4cpu x86) hangs while booting a kernel with SMP
> and preemption enabled. It hangs while executing one of
> the initcalls, probably BIO since that is where the
> next boot message comes from during a successful boot with SMP
> (or preemption) disabled.
> 
> Has anyone tried out preemption with SMP ?

Sure, all my testing is on SMP.  The problem manifested itself in
2.5.8-pre when some changes where made to the migration code.  The race
is in the migration code - I am not sure it is preempts fault, per se,
but the attached patch should fix it.  It is pending with Linus for the
next release.

	Robert Love

diff -urN linux-2.5.8/kernel/sched.c linux/kernel/sched.c
--- linux-2.5.8/kernel/sched.c	Sun Apr 14 15:18:47 2002
+++ linux/kernel/sched.c	Mon Apr 15 14:47:18 2002
@@ -1649,6 +1649,7 @@
 	if (!new_mask)
 		BUG();
 
+	preempt_disable();
 	rq = task_rq_lock(p, &flags);
 	p->cpus_allowed = new_mask;
 	/*
@@ -1657,7 +1658,7 @@
 	 */
 	if (new_mask & (1UL << p->thread_info->cpu)) {
 		task_rq_unlock(rq, &flags);
-		return;
+		goto out;
 	}
 
 	init_MUTEX_LOCKED(&req.sem);
@@ -1667,6 +1668,8 @@
 	wake_up_process(rq->migration_thread);
 
 	down(&req.sem);
+out:
+	preempt_enable();
 }
 
 static volatile unsigned long migration_mask;



  reply	other threads:[~2002-04-17 18:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-17 17:52 2.5.8: preemption + SMP broken ? Dipankar Sarma
2002-04-17 18:25 ` Robert Love [this message]
2002-04-17 19:04   ` Dipankar Sarma
2002-04-21 18:57   ` Pavel Machek
2002-04-22 18:16     ` Robert Love

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=1019067957.1669.46.camel@phantasy \
    --to=rml@tech9.net \
    --cc=dipankar@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.