From: Matthew Wilcox <matthew@wil.cx>
To: linux-arch@vger.kernel.org
Cc: rmk@arm.linux.org.uk, takata@linux-m32r.org, lethal@linux-sh.org,
kkojima@rr.iij4u.or.jp, linuxsh-dev@lists.sourceforge.net,
wli@holomorphy.com, sparclinux@vger.kernel.org
Subject: generic__raw_read_trylock Considered Harmful
Date: Thu, 31 Aug 2006 07:42:55 -0600 [thread overview]
Message-ID: <20060831134254.GE4919@parisc-linux.org> (raw)
Back in January 2005, Ingo wrote:
NOTE to architecture maintainers: generic_raw_read_trylock() is a crude
version that should be replaced with the proper arch-optimized version
ASAP.
He didn't really phrase that strongly enough. It should have read:
NOTE to architecture maintainers: generic_raw_read_trylock() is
completely unfit for use and will cause lockups if used in interrupt
context.
I propose we delete this from the tree, turning a rather nasty and hard
to track down runtime failure into a simple to fix buildtime failure on
the following architectures:
include/asm-arm/spinlock.h:#define __raw_read_trylock(lock) generic__raw_read_trylock(lock)
include/asm-m32r/spinlock.h:#define __raw_read_trylock(lock) generic__raw_read_trylock(lock)
include/asm-mips/spinlock.h:#define __raw_read_trylock(lock) generic__raw_read_trylock(lock)
include/asm-parisc/spinlock.h:#define __raw_read_trylock(lock) generic__raw_read_trylock(lock)
include/asm-sh/spinlock.h:#define __raw_read_trylock(lock) generic__raw_read_trylock(lock)
include/asm-sparc/spinlock.h:#define __raw_read_trylock(lock) generic__raw_read_trylock(lock)
MIPS is already fixed out of tree. ARM, M32R, SH and SPARC need to
be fixed. We're redoing the PA-RISC implementation right now, which is
how I noticed this, er, minor problem.
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index 31473db..6ed1e54 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -77,8 +77,6 @@ #define __lockfunc fastcall __attribute_
*/
#include <linux/spinlock_types.h>
-extern int __lockfunc generic__raw_read_trylock(raw_rwlock_t *lock);
-
/*
* Pull the __raw*() functions/declarations (UP-nondebug doesnt need them):
*/
diff --git a/kernel/spinlock.c b/kernel/spinlock.c
index bfd6ad9..c9f1541 100644
--- a/kernel/spinlock.c
+++ b/kernel/spinlock.c
@@ -16,17 +16,6 @@ #include <linux/interrupt.h>
#include <linux/debug_locks.h>
#include <linux/module.h>
-/*
- * Generic declaration of the raw read_trylock() function,
- * architectures are supposed to optimize this:
- */
-int __lockfunc generic__raw_read_trylock(raw_rwlock_t *lock)
-{
- __raw_read_lock(lock);
- return 1;
-}
-EXPORT_SYMBOL(generic__raw_read_trylock);
-
int __lockfunc _spin_trylock(spinlock_t *lock)
{
preempt_disable();
WARNING: multiple messages have this Message-ID (diff)
From: Matthew Wilcox <matthew@wil.cx>
To: linux-arch@vger.kernel.org
Cc: rmk@arm.linux.org.uk, takata@linux-m32r.org, lethal@linux-sh.org,
kkojima@rr.iij4u.or.jp, linuxsh-dev@lists.sourceforge.net,
wli@holomorphy.com, sparclinux@vger.kernel.org
Subject: generic__raw_read_trylock Considered Harmful
Date: Thu, 31 Aug 2006 13:42:55 +0000 [thread overview]
Message-ID: <20060831134254.GE4919@parisc-linux.org> (raw)
Back in January 2005, Ingo wrote:
NOTE to architecture maintainers: generic_raw_read_trylock() is a crude
version that should be replaced with the proper arch-optimized version
ASAP.
He didn't really phrase that strongly enough. It should have read:
NOTE to architecture maintainers: generic_raw_read_trylock() is
completely unfit for use and will cause lockups if used in interrupt
context.
I propose we delete this from the tree, turning a rather nasty and hard
to track down runtime failure into a simple to fix buildtime failure on
the following architectures:
include/asm-arm/spinlock.h:#define __raw_read_trylock(lock) generic__raw_read_trylock(lock)
include/asm-m32r/spinlock.h:#define __raw_read_trylock(lock) generic__raw_read_trylock(lock)
include/asm-mips/spinlock.h:#define __raw_read_trylock(lock) generic__raw_read_trylock(lock)
include/asm-parisc/spinlock.h:#define __raw_read_trylock(lock) generic__raw_read_trylock(lock)
include/asm-sh/spinlock.h:#define __raw_read_trylock(lock) generic__raw_read_trylock(lock)
include/asm-sparc/spinlock.h:#define __raw_read_trylock(lock) generic__raw_read_trylock(lock)
MIPS is already fixed out of tree. ARM, M32R, SH and SPARC need to
be fixed. We're redoing the PA-RISC implementation right now, which is
how I noticed this, er, minor problem.
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index 31473db..6ed1e54 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -77,8 +77,6 @@ #define __lockfunc fastcall __attribute_
*/
#include <linux/spinlock_types.h>
-extern int __lockfunc generic__raw_read_trylock(raw_rwlock_t *lock);
-
/*
* Pull the __raw*() functions/declarations (UP-nondebug doesnt need them):
*/
diff --git a/kernel/spinlock.c b/kernel/spinlock.c
index bfd6ad9..c9f1541 100644
--- a/kernel/spinlock.c
+++ b/kernel/spinlock.c
@@ -16,17 +16,6 @@ #include <linux/interrupt.h>
#include <linux/debug_locks.h>
#include <linux/module.h>
-/*
- * Generic declaration of the raw read_trylock() function,
- * architectures are supposed to optimize this:
- */
-int __lockfunc generic__raw_read_trylock(raw_rwlock_t *lock)
-{
- __raw_read_lock(lock);
- return 1;
-}
-EXPORT_SYMBOL(generic__raw_read_trylock);
-
int __lockfunc _spin_trylock(spinlock_t *lock)
{
preempt_disable();
next reply other threads:[~2006-08-31 13:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-31 13:42 Matthew Wilcox [this message]
2006-08-31 13:42 ` generic__raw_read_trylock Considered Harmful Matthew Wilcox
2006-08-31 14:10 ` Russell King
2006-08-31 14:10 ` Russell King
2006-09-19 22:53 ` David Miller
2006-09-19 22:53 ` David Miller
2006-09-20 15:33 ` Matthew Wilcox
2006-09-20 15:33 ` Matthew Wilcox
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=20060831134254.GE4919@parisc-linux.org \
--to=matthew@wil.cx \
--cc=kkojima@rr.iij4u.or.jp \
--cc=lethal@linux-sh.org \
--cc=linux-arch@vger.kernel.org \
--cc=linuxsh-dev@lists.sourceforge.net \
--cc=rmk@arm.linux.org.uk \
--cc=sparclinux@vger.kernel.org \
--cc=takata@linux-m32r.org \
--cc=wli@holomorphy.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 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.