Re: 64-bit ppc rwsem

2010-08-24 Thread Arnd Bergmann
On Tuesday 24 August 2010, Benjamin Herrenschmidt wrote: > On Mon, 2010-08-23 at 15:18 -0700, David Miller wrote: > > > I've seen drivers in the past do trylocks at interrupt time ... tho > > I > > > agree it sucks. > > > > Recently there was a thread where this was declared absolutely > > illegal

Re: 64-bit ppc rwsem

2010-08-23 Thread Benjamin Herrenschmidt
On Mon, 2010-08-23 at 15:18 -0700, David Miller wrote: > > I've seen drivers in the past do trylocks at interrupt time ... tho > I > > agree it sucks. > > Recently there was a thread where this was declared absolutely > illegal. > > Maybe it was allowed, or sort-of worked before, and that's why i

Re: 64-bit ppc rwsem

2010-08-23 Thread David Miller
From: Benjamin Herrenschmidt Date: Tue, 24 Aug 2010 08:01:25 +1000 > On Mon, 2010-08-23 at 15:44 +0200, Arnd Bergmann wrote: >> >> * Alpha has an optimization for the uniprocessor case, where the atomic >> instructions get turned into nonatomic additions. The spinlock based >> version uses no lo

Re: 64-bit ppc rwsem

2010-08-23 Thread Benjamin Herrenschmidt
On Mon, 2010-08-23 at 15:44 +0200, Arnd Bergmann wrote: > > * 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

Re: 64-bit ppc rwsem

2010-08-23 Thread Arnd Bergmann
On Thursday 19 August 2010, David Miller wrote: > From: Benjamin Herrenschmidt > 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-

Re: 64-bit ppc rwsem

2010-08-19 Thread Benjamin Herrenschmidt
On Wed, 2010-08-18 at 22:29 -0700, David Miller wrote: > From: Benjamin Herrenschmidt > 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

Re: 64-bit ppc rwsem

2010-08-18 Thread David Miller
From: Benjamin Herrenschmidt 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 b

Re: 64-bit ppc rwsem

2010-08-18 Thread Benjamin Herrenschmidt
On Tue, 2010-08-17 at 22:28 -0700, David Miller wrote: > From: Benjamin Herrenschmidt > Date: Wed, 18 Aug 2010 15:03:23 +1000 > > > I tried various tricks but so far they didn't work. I'll have another > > look tomorrow, but I may end up having to keep all the crap typecasts. > > The casts are p

Re: 64-bit ppc rwsem

2010-08-17 Thread David Miller
From: Sam Ravnborg Date: Wed, 18 Aug 2010 07:39:55 +0200 >> @@ -15,7 +15,7 @@ lib-$(CONFIG_SPARC32) += divdi3.o udivdi3.o >> lib-$(CONFIG_SPARC32) += copy_user.o locks.o >> lib-y += atomic_$(BITS).o >> lib-$(CONFIG_SPARC32) += lshrdi3.o ashldi3.o >> -lib-y += rw

Re: 64-bit ppc rwsem

2010-08-17 Thread Sam Ravnborg
> diff --git a/arch/sparc/lib/Makefile b/arch/sparc/lib/Makefile > index c4b5e03..fa4c3ea 100644 > --- a/arch/sparc/lib/Makefile > +++ b/arch/sparc/lib/Makefile > @@ -15,7 +15,7 @@ lib-$(CONFIG_SPARC32) += divdi3.o udivdi3.o > lib-$(CONFIG_SPARC32) += copy_user.o locks.o > lib-y +

Re: 64-bit ppc rwsem

2010-08-17 Thread David Miller
From: Benjamin Herrenschmidt Date: Wed, 18 Aug 2010 15:03:23 +1000 > I tried various tricks but so far they didn't work. I'll have another > look tomorrow, but I may end up having to keep all the crap typecasts. The casts are pretty much unavoidable. Here's what I'm going to end up using on spa

Re: 64-bit ppc rwsem (was: Re: [GIT] Sparc)

2010-08-17 Thread Benjamin Herrenschmidt
On Wed, 2010-08-18 at 14:38 +1000, Benjamin Herrenschmidt wrote: > > Here's an untested patch for the folks on linuxppc-dev to look at, > I'll > review my own stuff & test tomorrow. Allright, gcc's being a pain, and atomics are a struct so we can't that easily assign. I tried various tricks but