public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: paulus@samba.org
Cc: rml@tech9.net, george@mvista.com, linux-kernel@vger.kernel.org
Subject: Re: in_interrupt race
Date: Tue, 23 Apr 2002 13:25:24 +1000	[thread overview]
Message-ID: <20020423132524.2056739f.rusty@rustcorp.com.au> (raw)
In-Reply-To: <15556.38775.439624.762586@argo.ozlabs.ibm.com>

On Tue, 23 Apr 2002 09:06:31 +1000 (EST)
Paul Mackerras <paulus@samba.org> wrote:
> No.  The point is that in_interrupt() asks two separate questions:
> (1) which cpu are we on?  (2) is that cpu in interrupt context?
> If we switch cpus between (1) and (2) then we can get a false positive
> from in_interrupt().

Yes: the old CPU happens to be processing an interrupt now.
The neat solution is to follow Linus' original instinct and make
PREEMPT an option only for UP: I only like preempt because it brings
UP into line with SMP, effectively enlarging the SMP userbase to reasonable
size.

diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.9/arch/i386/config.in working-2.5.9-preempt/arch/i386/config.in
--- linux-2.5.9/arch/i386/config.in	Tue Apr 23 11:39:32 2002
+++ working-2.5.9-preempt/arch/i386/config.in	Tue Apr 23 13:19:58 2002
@@ -184,7 +184,6 @@
 bool 'Math emulation' CONFIG_MATH_EMULATION
 bool 'MTRR (Memory Type Range Register) support' CONFIG_MTRR
 bool 'Symmetric multi-processing support' CONFIG_SMP
-bool 'Preemptible Kernel' CONFIG_PREEMPT
 if [ "$CONFIG_SMP" != "y" ]; then
    bool 'Local APIC support on uniprocessors' CONFIG_X86_UP_APIC
    dep_bool 'IO-APIC support on uniprocessors' CONFIG_X86_UP_IOAPIC $CONFIG_X86_UP_APIC
@@ -195,6 +194,7 @@
       define_bool CONFIG_X86_IO_APIC y
    fi
 else
+   bool 'Preemptible Kernel' CONFIG_PREEMPT 
    bool 'Multiquad NUMA system' CONFIG_MULTIQUAD
 fi
 
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.9/arch/sparc64/config.in working-2.5.9-preempt/arch/sparc64/config.in
--- linux-2.5.9/arch/sparc64/config.in	Thu Mar 21 14:14:42 2002
+++ working-2.5.9-preempt/arch/sparc64/config.in	Tue Apr 23 13:20:48 2002
@@ -15,7 +15,7 @@
 define_bool CONFIG_VT_CONSOLE y
 
 bool 'Symmetric multi-processing support' CONFIG_SMP
-bool 'Preemptible kernel' CONFIG_PREEMPT
+dep_bool 'Preemptible kernel' CONFIG_PREEMPT $CONFIG_SMP
 
 # Identify this as a Sparc64 build
 define_bool CONFIG_SPARC64 y
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.9/arch/x86_64/config.in working-2.5.9-preempt/arch/x86_64/config.in
--- linux-2.5.9/arch/x86_64/config.in	Tue Apr 23 11:39:33 2002
+++ working-2.5.9-preempt/arch/x86_64/config.in	Tue Apr 23 13:20:59 2002
@@ -42,7 +42,7 @@
 #currently broken:
 #bool 'MTRR (Memory Type Range Register) support' CONFIG_MTRR
 bool 'Symmetric multi-processing support' CONFIG_SMP
-bool 'Preemptible Kernel' CONFIG_PREEMPT
+dep_bool 'Preemptible Kernel' CONFIG_PREEMPT $CONFIG_SMP
 if [ "$CONFIG_SMP" = "y" -a "$CONFIG_X86_CMPXCHG" = "y" ]; then
     define_bool CONFIG_HAVE_DEC_LOCK y
 fi

-- 
   there are those who do and those who hang on and you don't see too
   many doers quoting their contemporaries.  -- Larry McVoy

  parent reply	other threads:[~2002-04-23  3:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-20 10:27 in_interrupt race Paul Mackerras
2002-04-22 19:02 ` Robert Love
2002-04-22 21:39   ` george anzinger
2002-04-22 21:54     ` Robert Love
2002-04-22 23:06       ` Paul Mackerras
2002-04-22 23:15         ` Robert Love
2002-04-23  3:25         ` Rusty Russell [this message]
2002-04-23  8:31           ` Russell King
2002-04-24  4:43             ` Rusty Russell
2002-04-22 23:22     ` Paul Mackerras

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=20020423132524.2056739f.rusty@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=george@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.org \
    --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