mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zwane Mwaikambo <zwane@fsmlabs.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>, Keith Owens <kaos@sgi.com>
Subject: [PATCH][2.6-mm] i386: enable interrupts on contention in spin_lock_irq
Date: Wed, 26 May 2004 03:11:07 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.58.0405260250310.1794@montezuma.fsmlabs.com> (raw)

This little bit was missing from the previous patch. It will enable
interrupts whilst a cpu is spinning on a lock in spin_lock_irq as well as
spin_lock_irqsave. UP/SMP compile and runtime/stress tested on i386,
UP/SMP compile tested on amd64.

Signed-off-by: Zwane Mwaikambo <zwane@fsmlabs.com>

 include/asm-i386/spinlock.h |    1 +
 include/linux/spinlock.h    |    9 +++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

Index: linux-2.6.6-mm5/include/asm-i386/spinlock.h
===================================================================
RCS file: /home/cvsroot/linux-2.6.6-mm5/include/asm-i386/spinlock.h,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 spinlock.h
--- linux-2.6.6-mm5/include/asm-i386/spinlock.h	22 May 2004 16:45:24 -0000	1.1.1.1
+++ linux-2.6.6-mm5/include/asm-i386/spinlock.h	26 May 2004 05:36:34 -0000
@@ -174,6 +174,7 @@ here:
 		:"=m" (lock->lock) : : "memory");
 }

+#define _raw_spin_lock_irq(lock)	_raw_spin_lock_flags(lock, X86_EFLAGS_IF)
 static inline void _raw_spin_lock_flags (spinlock_t *lock, unsigned long flags)
 {
 #ifdef CONFIG_DEBUG_SPINLOCK
Index: linux-2.6.6-mm5/include/linux/spinlock.h
===================================================================
RCS file: /home/cvsroot/linux-2.6.6-mm5/include/linux/spinlock.h,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 spinlock.h
--- linux-2.6.6-mm5/include/linux/spinlock.h	22 May 2004 16:45:22 -0000	1.1.1.1
+++ linux-2.6.6-mm5/include/linux/spinlock.h	26 May 2004 06:36:55 -0000
@@ -44,9 +44,14 @@
 #ifdef CONFIG_SMP
 #include <asm/spinlock.h>

+#ifndef _raw_spin_lock_irq
+#define _raw_spin_lock_irq(lock)		_raw_spin_lock(lock)
+#endif
+
 #else

-#define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock)
+#define _raw_spin_lock_flags(lock, flags)	_raw_spin_lock(lock)
+#define _raw_spin_lock_irq(lock)		_raw_spin_lock(lock)

 #if !defined(CONFIG_PREEMPT) && !defined(CONFIG_DEBUG_SPINLOCK)
 # define atomic_dec_and_lock(atomic,lock) atomic_dec_and_test(atomic)
@@ -289,7 +294,7 @@ do { \
 do { \
 	local_irq_disable(); \
 	preempt_disable(); \
-	_raw_spin_lock(lock); \
+	_raw_spin_lock_irq(lock); \
 } while (0)

 #define spin_lock_bh(lock) \

             reply	other threads:[~2004-05-26  7:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-26  7:11 Zwane Mwaikambo [this message]
2004-05-26  7:29 ` Keith Owens
2004-05-26  7:48   ` Zwane Mwaikambo
2004-05-26  7:58   ` Duncan Sands
2004-05-26  8:11     ` Zwane Mwaikambo
2004-05-27  1:45       ` 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=Pine.LNX.4.58.0405260250310.1794@montezuma.fsmlabs.com \
    --to=zwane@fsmlabs.com \
    --cc=akpm@osdl.org \
    --cc=kaos@sgi.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 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®