From: Robert Love <rml@tech9.net>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Ingo Molnar <mingo@elte.hu>, linux-kernel@vger.kernel.org
Subject: Re: [patch] sti() preemption fix, 2.5.22
Date: 17 Jun 2002 10:20:53 -0700 [thread overview]
Message-ID: <1024334453.3090.54.camel@sinai> (raw)
In-Reply-To: <Pine.LNX.4.44.0206171003290.2580-100000@home.transmeta.com>
On Mon, 2002-06-17 at 10:04, Linus Torvalds wrote:
> Ingo, please use "get_cpu()/put_cpu()" instead, which does exactly the
> preempt-disable etc, and is more readable.
Here is Ingo's patch using the get_cpu()/put_cpu() interface where
needed...
Ingo, good catch!
Robert Love
diff -urN linux-2.5.22/arch/i386/kernel/irq.c linux/arch/i386/kernel/irq.c
--- linux-2.5.22/arch/i386/kernel/irq.c Sun Jun 16 19:31:24 2002
+++ linux/arch/i386/kernel/irq.c Mon Jun 17 10:19:18 2002
@@ -356,8 +356,9 @@
__save_flags(flags);
if (flags & (1 << EFLAGS_IF_SHIFT)) {
- int cpu = smp_processor_id();
+ int cpu;
__cli();
+ cpu = smp_processor_id();
if (!local_irq_count(cpu))
get_irqlock(cpu);
}
@@ -365,11 +366,15 @@
void __global_sti(void)
{
- int cpu = smp_processor_id();
+ int cpu;
+
+ cpu = get_cpu();
if (!local_irq_count(cpu))
release_irqlock(cpu);
__sti();
+
+ put_cpu();
}
/*
prev parent reply other threads:[~2002-06-17 17:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-17 15:01 [patch] sti() preemption fix, 2.5.22 Ingo Molnar
2002-06-17 16:15 ` Ingo Molnar
2002-06-17 17:04 ` Linus Torvalds
2002-06-17 17:17 ` Ingo Molnar
2002-06-17 17:20 ` Robert Love [this message]
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=1024334453.3090.54.camel@sinai \
--to=rml@tech9.net \
--cc=linux-kernel@vger.kernel.org \
--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