mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@zip.com.au>
To: Robert Love <rml@tech9.net>, lkml <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@elte.hu>
Subject: Re: preempt-related hangs
Date: Sun, 24 Mar 2002 18:11:51 -0800	[thread overview]
Message-ID: <3C9E8767.4F57CB0A@zip.com.au> (raw)
In-Reply-To: <3C9E8497.9355C462@zip.com.au>

Andrew Morton wrote:
> 
> ..
> Kernel is 2.5.7, dual PIII.  When I enable preempt it
> locks during boot.

OK, this patch fixed it.  I don't know why.


--- linux-2.5.7/kernel/sched.c	Mon Mar 18 13:04:41 2002
+++ 25/kernel/sched.c	Sun Mar 24 18:09:09 2002
@@ -1545,6 +1545,8 @@ void set_cpus_allowed(task_t *p, unsigne
 	migration_req_t req;
 	runqueue_t *rq;
 
+	preempt_disable();
+
 	new_mask &= cpu_online_map;
 	if (!new_mask)
 		BUG();
@@ -1557,7 +1559,7 @@ void set_cpus_allowed(task_t *p, unsigne
 	 */
 	if (new_mask & (1UL << p->thread_info->cpu)) {
 		task_rq_unlock(rq, &flags);
-		return;
+		goto out;
 	}
 
 	init_MUTEX_LOCKED(&req.sem);
@@ -1567,6 +1569,8 @@ void set_cpus_allowed(task_t *p, unsigne
 	wake_up_process(rq->migration_thread);
 
 	down(&req.sem);
+out:
+	preempt_disable();
 }
 
 static volatile unsigned long migration_mask;


-

  reply	other threads:[~2002-03-25  2:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-25  1:59 Andrew Morton
2002-03-25  2:11 ` Andrew Morton [this message]
2002-03-25  2:30   ` Robert Love
2002-03-25  2:33   ` Anton Altaparmakov
2002-03-25  2:40     ` Robert Love
2002-03-25  2:48     ` Andrew Morton
2002-03-25  8:04 ` Zwane Mwaikambo

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=3C9E8767.4F57CB0A@zip.com.au \
    --to=akpm@zip.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rml@tech9.net \
    /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®