From: Andrea Arcangeli <andrea@suse.de>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.4.19pre10aa3
Date: Thu, 20 Jun 2002 16:44:41 +0200 [thread overview]
Message-ID: <20020620144441.GM10718@dualathlon.random> (raw)
In-Reply-To: <20020620144033.GL10718@dualathlon.random>
On Thu, Jun 20, 2002 at 04:40:33PM +0200, Andrea Arcangeli wrote:
> however I noticed an smp bug in my changes, I was too aggressive
> removing the loop in task_rq_lock, not that such bug ever triggered yet
> but the rq may change under us while we take the lock if the task is
> getting migrated to another cpu.
just for reference, here it is the fix:
--- sched/kernel/sched.c.~1~ Thu Jun 20 16:42:41 2002
+++ sched/kernel/sched.c Thu Jun 20 16:43:36 2002
@@ -133,19 +133,13 @@ static inline runqueue_t *task_rq_lock(t
{
struct runqueue *rq;
- /*
- * 2.4 cannot be made preemptive or it can trigger preemption bugs all
- * over the place (just check the networking per-cpu data), so it's
- * pointless to disable irq before reading the current runqueue address.
- */
+repeat_lock_task:
rq = task_rq(p);
spin_lock_irqsave(&rq->lock, *flags);
- if (unlikely(rq != task_rq(p)))
- /*
- * Bug just in case somebody made the 2.4 kernel non preemptive
- * as an experiment on a non production system.
- */
- BUG();
+ if (unlikely(rq != task_rq(p))) {
+ spin_unlock_irqrestore(&rq->lock, *flags);
+ goto repeat_lock_task;
+ }
return rq;
}
Andrea
next prev parent reply other threads:[~2002-06-20 14:43 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-20 5:59 2.4.19pre10aa3 Andrea Arcangeli
2002-06-20 6:04 ` 2.4.19pre10aa3 David S. Miller
2002-06-20 6:30 ` 2.4.19pre10aa3 Andrea Arcangeli
2002-06-20 11:44 ` 2.4.19pre10aa3 Andrey Nekrasov
2002-06-20 13:19 ` 2.4.19pre10aa3 Andrea Arcangeli
2002-06-20 17:03 ` 2.4.19pre10aa3 Andrea Arcangeli
2002-06-20 13:05 ` 2.4.19pre10aa3 J.A. Magallon
2002-06-20 13:32 ` 2.4.19pre10aa3 Andrea Arcangeli
2002-06-20 14:07 ` 2.4.19pre10aa3 Andrea Arcangeli
2002-06-20 14:05 ` 2.4.19pre10aa3 Ingo Molnar
2002-06-20 14:40 ` 2.4.19pre10aa3 Andrea Arcangeli
2002-06-20 14:44 ` Andrea Arcangeli [this message]
2002-06-20 15:40 ` 2.4.19pre10aa3 Heinz Diehl
2002-06-20 22:48 ` 2.4.19pre10aa3 J.A. Magallon
2002-06-21 4:31 ` 2.4.19pre10aa3 Andrea Arcangeli
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=20020620144441.GM10718@dualathlon.random \
--to=andrea@suse.de \
--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 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.