public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Keith Owens <kaos@sgi.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [patch 2.6.15-rc5] Define an ia64 version of __raw_read_trylock
Date: Mon, 12 Dec 2005 03:04:56 +0000	[thread overview]
Message-ID: <5252.1134356696@kao2.melbourne.sgi.com> (raw)
In-Reply-To: <17916.1134185068@ocs3.ocs.com.au>

On Sun, 11 Dec 2005 18:34:18 -0800, 
"Luck, Tony" <tony.luck@intel.com> wrote:
>>IA64 is using the generic version of __raw_read_trylock, which always
>>waits for the lock to be free instead of returning when the lock is in
>>use.
>
>That sounds like a bug in the generic code.  A locking function
>with "try" in its name has some pretty obvious semantics!

Agreed, but there is too much variation in the rw lock implementations
for any generic version to handle them all, so generic__raw_read_trylock
has to default to a plain lock.

include/asm-alpha/spinlock_types.h:typedef struct {
include/asm-alpha/spinlock_types.h:	volatile unsigned int lock;
include/asm-alpha/spinlock_types.h:} raw_rwlock_t;
--
include/asm-arm/spinlock_types.h:typedef struct {
include/asm-arm/spinlock_types.h:	volatile unsigned int lock;
include/asm-arm/spinlock_types.h:} raw_rwlock_t;
--
include/asm-i386/spinlock_types.h:typedef struct {
include/asm-i386/spinlock_types.h:	volatile unsigned int lock;
include/asm-i386/spinlock_types.h:} raw_rwlock_t;
--
include/asm-ia64/spinlock_types.h:typedef struct {
include/asm-ia64/spinlock_types.h:	volatile unsigned int read_counter	: 31;
include/asm-ia64/spinlock_types.h:	volatile unsigned int write_lock	:  1;
include/asm-ia64/spinlock_types.h:} raw_rwlock_t;
--
include/asm-m32r/spinlock_types.h:typedef struct {
include/asm-m32r/spinlock_types.h:	volatile int lock;
include/asm-m32r/spinlock_types.h:} raw_rwlock_t;
--
include/asm-mips/spinlock_types.h:typedef struct {
include/asm-mips/spinlock_types.h:	volatile unsigned int lock;
include/asm-mips/spinlock_types.h:} raw_rwlock_t;
--
include/asm-parisc/spinlock_types.h:typedef struct {
include/asm-parisc/spinlock_types.h:	raw_spinlock_t lock;
include/asm-parisc/spinlock_types.h:	volatile int counter;
include/asm-parisc/spinlock_types.h:} raw_rwlock_t;
--
include/asm-powerpc/spinlock_types.h:typedef struct {
include/asm-powerpc/spinlock_types.h:	volatile signed int lock;
include/asm-powerpc/spinlock_types.h:} raw_rwlock_t;
--
include/asm-s390/spinlock_types.h:typedef struct {
include/asm-s390/spinlock_types.h:	volatile unsigned int lock;
include/asm-s390/spinlock_types.h:	volatile unsigned int owner_pc;
include/asm-s390/spinlock_types.h:} raw_rwlock_t;
--
include/asm-sh/spinlock_types.h:typedef struct {
include/asm-sh/spinlock_types.h:	raw_spinlock_t lock;
include/asm-sh/spinlock_types.h:	atomic_t counter;
include/asm-sh/spinlock_types.h:} raw_rwlock_t;
--
include/asm-sparc64/spinlock_types.h:typedef struct {
include/asm-sparc64/spinlock_types.h:	volatile unsigned int lock;
include/asm-sparc64/spinlock_types.h:} raw_rwlock_t;
--
include/asm-sparc/spinlock_types.h:typedef struct {
include/asm-sparc/spinlock_types.h:	volatile unsigned int lock;
include/asm-sparc/spinlock_types.h:} raw_rwlock_t;
--
include/asm-x86_64/spinlock_types.h:typedef struct {
include/asm-x86_64/spinlock_types.h:	volatile unsigned int lock;
include/asm-x86_64/spinlock_types.h:} raw_rwlock_t;

We should kill the generic__raw_read_trylock() and force each
implementation to define its own __raw_read_trylock().  IA64 is done,
who's next?

include/asm-arm/spinlock.h:#define __raw_read_trylock(lock) generic__raw_read_trylock(lock)
include/asm-ia64/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-sparc64/spinlock.h:#define __raw_read_trylock(lock) generic__raw_read_trylock(lock)


  parent reply	other threads:[~2005-12-12  3:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-10  3:24 [patch 2.6.15-rc5] Define an ia64 version of __raw_read_trylock Keith Owens
2005-12-12  2:34 ` Luck, Tony
2005-12-12  3:04 ` Keith Owens [this message]
2005-12-12  6:16 ` Zou Nan hai
2005-12-12 13:20 ` Keith Owens

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=5252.1134356696@kao2.melbourne.sgi.com \
    --to=kaos@sgi.com \
    --cc=linux-ia64@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