From: Arnd Bergmann <arnd@arndb•de>
To: linuxppc-dev@lists•ozlabs.org
Cc: paulus@au•ibm.com, linux-kernel@vger•kernel.org,
sparclinux@vger•kernel.org, akpm@linux-foundation•org,
torvalds@linux-foundation•org, David Miller <davem@davemloft•net>
Subject: Re: 64-bit ppc rwsem
Date: Mon, 23 Aug 2010 15:44:16 +0200 [thread overview]
Message-ID: <201008231544.16422.arnd@arndb.de> (raw)
In-Reply-To: <20100818.222925.233689776.davem@davemloft.net>
On Thursday 19 August 2010, David Miller wrote:
> From: Benjamin Herrenschmidt <benh@kernel•crashing.org>
> Date: Thu, 19 Aug 2010 15:23:23 +1000
>
> > Similar here, but using atomic_long_t instead so it works for 32-bit too
> > for me. I suppose we could make that part common indeed.
> >
> > What about asm-generic/rwsem-atomic.h or rwsem-cmpxchg.h ?
>
> Using rwsem-cmpxchg.h sounds best I guess.
The implementation looks good for asm-generic, but there is now an asymmetry
between the spinlock and the atomic_long_t based version.
Maybe we can make them both do the same thing, either of
1. create include/linux/rwsem-cmpxchg.h and add an
#elif defined(CONFIG_RWSEM_GENERIC_ATOMIC) to include/linux/rwsem.h
2. move include/linux/rwsem-spinlock.h to include/asm-generic/ and
include that from all architectures that want the spinlock based version.
Further comments:
* Alpha has an optimization for the uniprocessor case, where the atomic
instructions get turned into nonatomic additions. The spinlock based
version uses no locks on UP but disables interrupts for reasons I don't
understand (nothing running at interrupt time should try to access an rwsem).
Should the generic version do the same as Alpha?
* Is there any architecture that would still benefit from having a separate
rwsem implementation? AFAICT all the remaining ones are just variations of
the same concept of using cmpxchg (or xadd in case of x86), which is what
atomics typically end up doing anyway.
Arnd
next prev parent reply other threads:[~2010-08-23 13:44 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20100817.180325.104051399.davem@davemloft.net>
[not found] ` <AANLkTikQ1dGw0aO10_ZwmVEc-JAVhB==3HS7SrWycE49@mail.gmail.com>
[not found] ` <AANLkTimZ3rhX2AzPExEGfRCXiFNN-BGOWRKqL241-qNa@mail.gmail.com>
[not found] ` <20100817.191424.183031381.davem@davemloft.net>
2010-08-18 4:38 ` 64-bit ppc rwsem (was: Re: [GIT] Sparc) Benjamin Herrenschmidt
2010-08-18 5:03 ` Benjamin Herrenschmidt
2010-08-18 5:28 ` 64-bit ppc rwsem David Miller
2010-08-18 5:39 ` Sam Ravnborg
2010-08-18 5:48 ` David Miller
2010-08-19 5:23 ` Benjamin Herrenschmidt
2010-08-19 5:29 ` David Miller
2010-08-19 10:24 ` Benjamin Herrenschmidt
2010-08-20 5:14 ` [PATCH 2/2] rwsem: Move powerpc atomic-long based implementation to asm-generic Benjamin Herrenschmidt
2010-08-20 6:43 ` Sam Ravnborg
2010-08-24 1:32 ` Benjamin Herrenschmidt
2010-08-23 4:39 ` David Miller
2010-08-20 5:14 ` [PATCH 1/2] powerpc: Make rwsem use "long" type Benjamin Herrenschmidt
2010-08-24 1:37 ` Timur Tabi
2010-08-23 13:44 ` Arnd Bergmann [this message]
2010-08-23 22:01 ` 64-bit ppc rwsem Benjamin Herrenschmidt
2010-08-23 22:18 ` David Miller
2010-08-24 1:31 ` Benjamin Herrenschmidt
2010-08-24 12:06 ` Arnd Bergmann
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=201008231544.16422.arnd@arndb.de \
--to=arnd@arndb$(echo .)de \
--cc=akpm@linux-foundation$(echo .)org \
--cc=davem@davemloft$(echo .)net \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=paulus@au$(echo .)ibm.com \
--cc=sparclinux@vger$(echo .)kernel.org \
--cc=torvalds@linux-foundation$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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