Re: FW: [PATCH] powerpc/mm: Export HPAGE_SHIFT

2009-02-03 Thread Nick Piggin
On Wednesday 04 February 2009 16:13:29 Andrew Morton wrote: > On Wed, 04 Feb 2009 12:50:48 +1100 Benjamin Herrenschmidt > > Do the generic hugetlbfs code provides such an API ? If not, we may need > > to add one. > > I think it's something like > > huge_page_size(page_hstate(page)) That wou

Re: next Feb 10: mm/slqb build break

2009-02-11 Thread Nick Piggin
On Tue, Feb 10, 2009 at 01:53:51PM +0200, Pekka Enberg wrote: > On Tue, Feb 10, 2009 at 11:54 AM, Sachin P. Sant wrote: > > Sachin P. Sant wrote: > >> > >> Hi Stephen, > >> > >> Todays next randconfig build on powerpc fails with > >> > >>  CC      mm/slqb.o > >> mm/slqb.c: In function __slab_free:

Re: next-20090216: slqb

2009-02-17 Thread Nick Piggin
On Tue, Feb 17, 2009 at 03:55:40AM +0300, Alexey Dobriyan wrote: > FYI, on powerpc-64-smp-n-debug-n: > > mm/slqb.c: In function '__slab_free': > mm/slqb.c:1648: error: implicit declaration of function 'slab_free_to_remote' > mm/slqb.c: In function 'kmem_cache_open': > mm/slqb.c:2174: error: implic

[patch] powerpc: estimate G5 cpufreq transition latency

2009-02-19 Thread Nick Piggin
deally the generic code would be able to measure it in case the platform does not provide it. But this simple patch at least makes it throttle again. Signed-off-by: Nick Piggin --- Index: linux-2.6/arch/powerpc/platforms/powermac/cp

[patch 2/2] powerpc: replace isync with lwsync

2009-02-19 Thread Nick Piggin
OK, here is this patch again. You didn't think I'd let a 2% performance improvement be forgotten? :) Anyway, patch won't work well on architecture without lwsync, but I won't bother fixing that kind of thing and making it merge worthy until you guys say something positive about it. 20 runs of tbe

[patch 1/2] powerpc: optimise smp_mb

2009-02-19 Thread Nick Piggin
Using lwsync, isync sequence in a microbenchmark is 5 times faster on my G5 than using sync for smp_mb. Although it takes more instructions. Running tbench with 4 clients on my 4 core G5 (20 times) gives the following: unpatched AVG=920.33 STD=2.36 patched AVG=921.27 STD=2.77 So not a big imp

Re: [patch 1/2] powerpc: optimise smp_mb

2009-03-04 Thread Nick Piggin
On Wed, Mar 04, 2009 at 03:03:15PM +1100, Benjamin Herrenschmidt wrote: > Allright, sorry for the delay, I had those stored into my "need more > than half a brain cell for review" list and only got to them today :-) No problem :) > On Thu, 2009-02-19 at 18:12 +0100

Re: [patch 2/2] powerpc: replace isync with lwsync

2009-03-04 Thread Nick Piggin
On Wed, Mar 04, 2009 at 03:04:11PM +1100, Benjamin Herrenschmidt wrote: > On Thu, 2009-02-19 at 18:21 +0100, Nick Piggin wrote: > > OK, here is this patch again. You didn't think I'd let a 2% performance > > improvement be forgotten? :) > > > > Anyway,

Re: Next April 28: boot failure on PowerPC with SLQB

2009-04-29 Thread Nick Piggin
On Tue, Apr 28, 2009 at 02:22:06PM +0300, Pekka Enberg wrote: > Nick, > > Here's another one. I think we need to either fix these rather quickly > or make SLUB the defaut for linux-next again so we don't interfere > with other testing. Yeah, I'm working on it. Let me either give you a fix or a pa

Re: Next April 28: boot failure on PowerPC with SLQB

2009-04-29 Thread Nick Piggin
0x1c/0x44 OK I think the problem is that with 64K pages you get a default MAX_ORDER of 9, and slqb is trying to create slabs which exceed that size.. Does this help? --- SLQB: fix slab calculation SLQB didn't consider MAX_ORDER when defining which sizes of kmalloc slabs to create. It panics at

Re: Next April 28: boot failure on PowerPC with SLQB

2009-04-29 Thread Nick Piggin
On Wed, Apr 29, 2009 at 09:56:19PM +0530, Sachin Sant wrote: > Nick Piggin wrote: > >Does this help? > >--- > With the patch the machine boots past the failure point, but panics > immediately with the following trace... OK good, that solves one problem. > Unable to hand

Re: Next April 28: boot failure on PowerPC with SLQB

2009-04-29 Thread Nick Piggin
On Thu, Apr 30, 2009 at 11:06:36AM +0530, Sachin Sant wrote: > Nick Piggin wrote: > >Well kmalloc is failing. It should not be though, even if the > >current node is offline, it should be able to fall back to other > >nodes. Stephen's trace indicates the same thing

Re: Next April 28: boot failure on PowerPC with SLQB

2009-04-29 Thread Nick Piggin
On Thu, Apr 30, 2009 at 11:06:36AM +0530, Sachin Sant wrote: > Nick Piggin wrote: > >Well kmalloc is failing. It should not be though, even if the > >current node is offline, it should be able to fall back to other > >nodes. Stephen's trace indicates the same thing

Re: Next April 28: boot failure on PowerPC with SLQB

2009-04-30 Thread Nick Piggin
On Thu, Apr 30, 2009 at 03:17:12PM +0530, Sachin Sant wrote: > Nick Piggin wrote: > >Hmm, forget that. Actually my last patch had a silly mistake because I > >forgot MAX_ORDER shift is applied to PAGE_SIZE, rather than 1. So > >kmalloc(PAGE_SIZE) was failing as too large. >

Re: [PATCH 1/6] powerpc: Use lwarx hint in spinlocks

2010-02-10 Thread Nick Piggin
On Wed, Feb 10, 2010 at 09:57:28PM +1100, Anton Blanchard wrote: > > Recent versions of the PowerPC architecture added a hint bit to the larx > instructions to differentiate between an atomic operation and a lock > operation: > > > 0 Other programs might attempt to modify the word in storage add

Re: [PATCH 6/6] powerpc: Use lwsync for acquire barrier if CPU supports it

2010-02-10 Thread Nick Piggin
On Wed, Feb 10, 2010 at 10:10:25PM +1100, Anton Blanchard wrote: > > Nick Piggin discovered that lwsync barriers around locks were faster than > isync > on 970. That was a long time ago and I completely dropped the ball in testing > his patches across other ppc64 processors. >

Re: [PATCH 1/6] powerpc: Use lwarx hint in spinlocks

2010-02-17 Thread Nick Piggin
On Wed, Feb 17, 2010 at 08:37:14PM +1100, Anton Blanchard wrote: > > Hi Nick, > > > Cool. How does it go when there are significant amount of instructions > > between the lock and the unlock? A real(ish) workload, like dbench on > > ramdisk (which should hit the dcache lock). > > Good question,

Re: [PATCH 6/6] powerpc: Use lwsync for acquire barrier if CPU supports it

2010-02-17 Thread Nick Piggin
On Wed, Feb 17, 2010 at 08:43:14PM +1100, Anton Blanchard wrote: > > Hi Nick, > > > Ah, good to see this one come back. I also tested tbench over localhost > > btw which actually did show some speedup on the G5. > > > > BTW. this was the last thing left: > > http://www.mail-archive.com/linuxpp

Re: [PATCH 4/6] powerpc: Rename LWSYNC_ON_SMP to PPC_RELEASE_BARRIER, ISYNC_ON_SMP to PPC_ACQUIRE_BARRIER

2010-03-18 Thread Nick Piggin
On Wed, Feb 10, 2010 at 10:04:06PM +1100, Anton Blanchard wrote: > > For performance reasons we are about to change ISYNC_ON_SMP to sometimes be > lwsync. Now that the macro name doesn't make sense, change it and > LWSYNC_ON_SMP > to better explain what the barriers are doing. > > Signed-off-by:

Re: [PATCH 1/2] mm/vmalloc: Export purge_vmap_area_lazy()

2010-03-24 Thread Nick Piggin
On Wed, Mar 24, 2010 at 06:56:31PM +1100, Benjamin Herrenschmidt wrote: > Some powerpc code needs to ensure that all previous iounmap/vunmap has > really been flushed out of the MMU hash table. Without that, various > hotplug operations may fail when trying to return those pieces to > the hyperviso

Re: [patch 11/14] powerpc: invoke oom-killer from page fault

2010-04-23 Thread Nick Piggin
, rather than > > simply killing current. > > > > Cc: linuxppc-...@ozlabs.org > > Cc: Benjamin Herrenschmidt > > Cc: linux-a...@vger.kernel.org > > Signed-off-by: Nick Piggin > > --- > > Index: linux-2.6/arch/powerpc/mm/fault.c > >

Re: [patch 1/1] powerpc: add rcu_read_lock() to gup_fast() implementation

2010-04-27 Thread Nick Piggin
ants to support. > > Therefore, also take the RCU read lock along with disabling IRQs to ensure > the RCU grace period does at least cover these lookups. > > Signed-off-by: Peter Zijlstra > Requested-by: Paul E. McKenney > Cc: Nick Piggin > Cc: Benjamin Herrenschmidt >

Re: Oops while running fs_racer test on a POWER6 box against latest git

2010-07-01 Thread Nick Piggin
gt; > [c0010978fc80] [c008deb4] .do_fork+0x190/0x3cc > > [c0010978fdc0] [c0011ef4] .sys_clone+0x58/0x70 > > [c0010978fe30] [c00087f0] .ppc_clone+0x8/0xc > > Instruction dump: > > 419e0010 7fe3fb78 480774cd 6000 801f0014 e93f0008 7800b842 392

Re: Oops while running fs_racer test on a POWER6 box against latest git

2010-07-09 Thread Nick Piggin
On Fri, Jul 09, 2010 at 09:34:16AM +0200, Jens Axboe wrote: > On 2010-07-09 08:57, divya wrote: > > On Friday 02 July 2010 12:16 PM, divya wrote: > >> On Thursday 01 July 2010 11:55 PM, Maciej Rutecki wrote: > >>> On środa, 30 czerwca 2010 o 13:22:27 divya wrote: > While running fs_racer test

Re: Next April 28: boot failure on PowerPC with SLQB

2009-04-30 Thread Nick Piggin
On Thu, Apr 30, 2009 at 09:00:04PM +1000, Stephen Rothwell wrote: > Hi Pekka, Nick, > > On Thu, 30 Apr 2009 13:38:04 +0300 Pekka Enberg > wrote: > > > > Stephen, does this patch fix all the boot problems for you as well? > > Unfortunately not, I am still getting this: > > Memory: 1967708k/2097

Re: Next April 28: boot failure on PowerPC with SLQB

2009-04-30 Thread Nick Piggin
On Thu, Apr 30, 2009 at 02:20:29PM +0300, Pekka Enberg wrote: > On Thu, 2009-04-30 at 13:18 +0200, Nick Piggin wrote: > > OK thanks. So I think we have 2 problems. One with MAX_ORDER <= 9 > > that is fixed by the previous patch, and another which is probably > > due to ha

Re: Next April 28: boot failure on PowerPC with SLQB

2009-04-30 Thread Nick Piggin
On Thu, Apr 30, 2009 at 02:20:29PM +0300, Pekka Enberg wrote: > On Thu, 2009-04-30 at 13:18 +0200, Nick Piggin wrote: > > OK thanks. So I think we have 2 problems. One with MAX_ORDER <= 9 > > that is fixed by the previous patch, and another which is probably > > due to ha

Re: Next April 28: boot failure on PowerPC with SLQB

2009-04-30 Thread Nick Piggin
On Fri, May 01, 2009 at 12:00:33AM +1000, Stephen Rothwell wrote: > Hi Nick, > > On Thu, 30 Apr 2009 15:05:42 +0200 Nick Piggin wrote: > > > > Hmm, this might do it. The following code now passes some stress testing > > in a userspace harness wheras before it did n

Re: Next May 11 : BUG during scsi initialization

2009-05-11 Thread Nick Piggin
On Mon, May 11, 2009 at 06:21:35AM -0600, Matthew Wilcox wrote: > On Mon, May 11, 2009 at 05:34:07PM +0530, Sachin Sant wrote: > > Matthew Wilcox wrote: > >> On Mon, May 11, 2009 at 05:16:10PM +0530, Sachin Sant wrote: > >> > >>> Today's Next tree failed to boot on a Power6 box with following BU

Re: Next May 11 : BUG during scsi initialization

2009-05-11 Thread Nick Piggin
On Tue, May 12, 2009 at 03:56:13PM +1000, Stephen Rothwell wrote: > Hi Nick, > > On Tue, 12 May 2009 06:57:16 +0200 Nick Piggin wrote: > > > > Hmm, I think (hope) your problems were fixed with the recent memory > > coruption bug fix for SLQB. (if not, let me know)

Re: Next May 11 : BUG during scsi initialization

2009-05-11 Thread Nick Piggin
On Tue, May 12, 2009 at 04:52:45PM +1000, Stephen Rothwell wrote: > Hi Nick, > > On Tue, 12 May 2009 16:03:52 +1000 Stephen Rothwell > wrote: > > > > This is what I have been getting for the last few days: > > bisected into the net changes, I will follow up there, sorry. No problem. Phew, your

Re: [Powerpc/SLQB] Next June 06 : BUG during scsi initialization

2009-06-09 Thread Nick Piggin
On Mon, Jun 08, 2009 at 05:42:14PM +0530, Sachin Sant wrote: > Pekka J Enberg wrote: > >Hi Sachin, > __slab_alloc_page: nid=2, cache_node=c000de01ba00, > cache_list=c000de01ba00 > __slab_alloc_page: nid=2, cache_node=c000de01bd00, > cache_list=c000de01bd00 > __slab_alloc_page: nid

Re: [Powerpc/SLQB] Next June 06 : BUG during scsi initialization

2009-06-12 Thread Nick Piggin
On Fri, Jun 12, 2009 at 11:14:10AM +0530, Sachin Sant wrote: > Nick Piggin wrote: > >I can't really work it out. It seems to be the kmem_cache_cache which has > >a problem, but there have already been lots of caches created and even > >this samw cache_node already use

Re: [Powerpc/SLQB] Next June 06 : BUG during scsi initialization

2009-06-12 Thread Nick Piggin
On Fri, Jun 12, 2009 at 01:38:50PM +0530, Sachin Sant wrote: > Nick Piggin wrote: > >>I was able to boot yesterday's next (20090611) on this machine. Not sure > >> > > > >Still with SLQB? With debug options turned on? > > > Ah .. spoke too soo

Re: [RFC/PATCH] mm: Pass virtual address to [__]p{te, ud, md}_free_tlb()

2009-07-15 Thread Nick Piggin
On Wed, Jul 15, 2009 at 05:49:47PM +1000, Benjamin Herrenschmidt wrote: > Upcoming paches to support the new 64-bit "BookE" powerpc architecture > will need to have the virtual address corresponding to PTE page when > freeing it, due to the way the HW table walker works. > > Basically, the TLB can

Re: [RFC/PATCH] mm: Pass virtual address to [__]p{te, ud, md}_free_tlb()

2009-07-20 Thread Nick Piggin
On Mon, Jul 20, 2009 at 05:11:13PM +1000, Benjamin Herrenschmidt wrote: > On Wed, 2009-07-15 at 15:56 +0200, Nick Piggin wrote: > > > I would like to merge the new support that depends on this in 2.6.32, > > > so unless there's major objections, I'd like this to go

Re: [RFC/PATCH] mm: Pass virtual address to [__]p{te, ud, md}_free_tlb()

2009-07-20 Thread Nick Piggin
On Thu, Jul 16, 2009 at 11:54:15AM +1000, Benjamin Herrenschmidt wrote: > On Wed, 2009-07-15 at 15:56 +0200, Nick Piggin wrote: > > Interesting arrangement. So are these last level ptes modifieable > > from userspace or something? If not, I wonder if you could manage > > the

Re: [RFC/PATCH] mm: Pass virtual address to [__]p{te, ud, md}_free_tlb()

2009-07-20 Thread Nick Piggin
On Mon, Jul 20, 2009 at 08:00:41PM +1000, Benjamin Herrenschmidt wrote: > On Mon, 2009-07-20 at 10:10 +0200, Nick Piggin wrote: > > > > Maybe I don't understand your description correctly. The TLB contains > > PMDs, but you say the HW still logically performs another

Re: [RFC/PATCH] mm: Pass virtual address to [__]p{te, ud, md}_free_tlb()

2009-07-20 Thread Nick Piggin
On Mon, Jul 20, 2009 at 07:59:21PM +1000, Benjamin Herrenschmidt wrote: > On Mon, 2009-07-20 at 10:05 +0200, Nick Piggin wrote: > > > > Unless anybody has other preferences, just send it straight to Linus in > > the next merge window -- if any conflicts did come up any

Re: [RFC/PATCH] mm: Pass virtual address to [__]p{te, ud, md}_free_tlb()

2009-07-21 Thread Nick Piggin
On Tue, Jul 21, 2009 at 10:02:26AM +1000, Benjamin Herrenschmidt wrote: > On Mon, 2009-07-20 at 12:38 +0200, Nick Piggin wrote: > > On Mon, Jul 20, 2009 at 08:00:41PM +1000, Benjamin Herrenschmidt wrote: > > > On Mon, 2009-07-20 at 10:10 +0200, Nick Piggin wrote: > > &g

Re: [PATCH 1/3] Fix Unlikely(x) == y

2008-02-18 Thread Nick Piggin
On Tuesday 19 February 2008 01:39, Andi Kleen wrote: > Arjan van de Ven <[EMAIL PROTECTED]> writes: > > you have more faith in the authors knowledge of how his code actually > > behaves than I think is warranted :) > > iirc there was a mm patch some time ago to keep track of the actual > unlikely

Re: [PATCH 1/3] Fix Unlikely(x) == y

2008-02-18 Thread Nick Piggin
On Tuesday 19 February 2008 13:40, Arjan van de Ven wrote: > On Tue, 19 Feb 2008 13:33:53 +1100 > > Nick Piggin <[EMAIL PROTECTED]> wrote: > > Actually one thing I don't like about gcc is that I think it still > > emits cmovs for likely/unlikely branches, which

Re: [PATCH 1/3] Fix Unlikely(x) == y

2008-02-18 Thread Nick Piggin
On Tuesday 19 February 2008 16:58, Willy Tarreau wrote: > On Tue, Feb 19, 2008 at 01:33:53PM +1100, Nick Piggin wrote: > > > Note in particular the last predictors; assuming branch ending > > > with goto, including call, causing early function return or > > > retur

Re: [PATCH 1/3] Fix Unlikely(x) == y

2008-02-19 Thread Nick Piggin
On Tuesday 19 February 2008 20:25, Andi Kleen wrote: > On Tue, Feb 19, 2008 at 01:33:53PM +1100, Nick Piggin wrote: > > I actually once measured context switching performance in the scheduler, > > and removing the unlikely hint for testing RT tasks IIRC gave about 5% > > per

Re: [PATCH 1/3] Fix Unlikely(x) == y

2008-02-19 Thread Nick Piggin
On Tuesday 19 February 2008 20:57, Andi Kleen wrote: > On Tue, Feb 19, 2008 at 08:46:46PM +1100, Nick Piggin wrote: > > I think it was just a simple context switch benchmark, but not lmbench > > (which I found to be a bit too variable). But it was a long time ago... > >

Re: [PATCH] synchronize_irq needs a barrier

2007-10-18 Thread Nick Piggin
On Friday 19 October 2007 12:32, Herbert Xu wrote: > First of all let's agree on some basic assumptions: > > * A pair of spin lock/unlock subsumes the effect of a full mb. Not unless you mean a pair of spin lock/unlock as in 2 spin lock/unlock pairs (4 operations). *X = 10; spin_lock(&lock); /*

Re: [PATCH] synchronize_irq needs a barrier

2007-10-18 Thread Nick Piggin
On Friday 19 October 2007 13:28, Herbert Xu wrote: > Nick Piggin <[EMAIL PROTECTED]> wrote: > >> First of all let's agree on some basic assumptions: > >> > >> * A pair of spin lock/unlock subsumes the effect of a full mb. > > > > Not unless you

[patch] xmon bitlock fix

2007-11-19 Thread Nick Piggin
or is tolerated, while the lack of a memory barrier could allow incorrect results during normal functioning operation as well. Convert it to use a regular spinlock instead. Signed-off-by: Nick Piggin <[EMAIL PROTECTED]> Acked-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]> --- Index: linu

[patch] powerpc: hash lock use lock bitops

2007-11-19 Thread Nick Piggin
This isn't a bugfix, but may help performance slightly... -- powerpc 64-bit hash pte lock bit is an actual lock, so it can take advantage of lock bitops for slightly more optimal memory barriers (can avoid an lwsync in the trylock). Signed-off-by: Nick Piggin <[EMAIL PROTECTED]&g

Re: [patch] xmon bitlock fix

2007-11-19 Thread Nick Piggin
On Tue, Nov 20, 2007 at 04:28:02PM +1100, Paul Mackerras wrote: > Nick Piggin writes: > > > xmon uses a bit lock spinlock but doesn't close the critical section > > when releasing it. It doesn't seem like a big deal because it will > > eventually break out

Re: [patch] powerpc: hash lock use lock bitops

2007-11-19 Thread Nick Piggin
On Tue, Nov 20, 2007 at 05:08:24PM +1100, Benjamin Herrenschmidt wrote: > > On Tue, 2007-11-20 at 06:09 +0100, Nick Piggin wrote: > > This isn't a bugfix, but may help performance slightly... > > > > -- > > powerpc 64-bit hash pte lock bit is an actual lock, s

Re: [PATCH 1/3] POWERPC: don't cast a pointer to pointer of list_head

2007-12-06 Thread Nick Piggin
On Thursday 06 December 2007 20:33, Li Zefan wrote: > The casting is safe only when the list_head member is the > first member of the structure. Even so, I don't think too safe :) It might technically work, but it could break more easily. So even if you find places where list_head is the first me

[patch 1/2] powerpc: rmb fix

2007-08-20 Thread Nick Piggin
loads including device memory. Signed-off-by: Nick Piggin <[EMAIL PROTECTED]> Index: linux-2.6/include/asm-powerpc/system.h === --- linux-2.6.orig/include/asm-powerpc/system.h +++ linux-2.6/include/asm-powerpc/system.h @@

[patch 1/2] powerpc: smp_wmb speedup

2007-08-20 Thread Nick Piggin
The on sub-architectures where lwsync is unavailable, eieio is retained, as it should be faster than the alternative full sync (eieio is a proper subset of sync). Signed-off-by: Nick Piggin <[EMAIL PROTECTED]> Index: linux-2.6/include/asm-

Re: [patch 1/2] powerpc: smp_wmb speedup

2007-08-20 Thread Nick Piggin
Sorry, this is patch 2/2 of course. On Tue, Aug 21, 2007 at 04:16:52AM +0200, Nick Piggin wrote: > This one is perhaps not as straightforward. I'm pretty limited in the types > of powerpc machines I can test with, so I don't actually know whether this > is the right thing to do

Re: [patch 1/2] powerpc: rmb fix

2007-08-21 Thread Nick Piggin
On Tue, Aug 21, 2007 at 09:43:17PM +0200, Segher Boessenkool wrote: > >> #define mb() __asm__ __volatile__ ("sync" : : : "memory") > >>-#define rmb() __asm__ __volatile__ (__stringify(LWSYNC) : : : > >>"memory") > >>+#define rmb() __asm__ __volatile__ ("sync" : : : "memory") > >> #define wmb()

Re: [patch 1/2] powerpc: rmb fix

2007-08-21 Thread Nick Piggin
On Tue, Aug 21, 2007 at 09:43:17PM +0200, Segher Boessenkool wrote: > >> #define mb() __asm__ __volatile__ ("sync" : : : "memory") > >>-#define rmb() __asm__ __volatile__ (__stringify(LWSYNC) : : : > >>"memory") > >>+#define rmb() __asm__ __volatile__ ("sync" : : : "memory") > >> #define wmb()

Re: [patch 1/2] powerpc: rmb fix

2007-08-21 Thread Nick Piggin
On Wed, Aug 22, 2007 at 05:29:50AM +0200, Segher Boessenkool wrote: > >>>If this isn't causing any problems maybe there > >>>is some loigic we are overlooking? > >> > >>The I/O accessor functions enforce the necessary ordering > >>already I believe. > > > >Ah, it looks like you might be right, IO s

Re: [patch 1/2] powerpc: rmb fix

2007-08-21 Thread Nick Piggin
On Wed, Aug 22, 2007 at 05:33:16AM +0200, Segher Boessenkool wrote: > >>The I/O accessor functions enforce the necessary ordering > >>already I believe. > > > >Hmm, I never followed those discussions last year about IO ordering, > >and > >I can't see where (if) it was documented anywhere :( > > T

wmb vs mmiowb

2007-08-21 Thread Nick Piggin
Hi, I'm ignorant when it comes to IO access, so I hope this isn't rubbish (if it is, I would appreciate being corrected). It took me more than a glance to see what the difference is supposed to be between wmb() and mmiowb(). I think especially because mmiowb isn't really like a write barrier. wm

Re: wmb vs mmiowb

2007-08-22 Thread Nick Piggin
On Wed, Aug 22, 2007 at 11:07:32AM -0700, Linus Torvalds wrote: > > > On Wed, 22 Aug 2007, Nick Piggin wrote: > > > > It took me more than a glance to see what the difference is supposed to be > > between wmb() and mmiowb(). I think especially because mmiowb is

Re: wmb vs mmiowb

2007-08-22 Thread Nick Piggin
On Wed, Aug 22, 2007 at 12:02:11PM -0700, Jesse Barnes wrote: > On Wednesday, August 22, 2007 11:07 am Linus Torvalds wrote: > > > It really seems like it is some completely different concept from a > > > barrier. And it shows, on the platform where it really matters > > > (sn2), where the thing ac

Re: wmb vs mmiowb

2007-08-22 Thread Nick Piggin
On Wed, Aug 22, 2007 at 07:57:56PM -0700, Linus Torvalds wrote: > > > On Thu, 23 Aug 2007, Nick Piggin wrote: > > > > > Irix actually had an io_unlock() routine that did this > > > implicitly, but iirc that was shot down for Linux... > > > > Why wa

Re: wmb vs mmiowb

2007-08-22 Thread Nick Piggin
On Wed, Aug 22, 2007 at 07:57:56PM -0700, Linus Torvalds wrote: > > > On Thu, 23 Aug 2007, Nick Piggin wrote: > > > > > Irix actually had an io_unlock() routine that did this > > > implicitly, but iirc that was shot down for Linux... > > > > Why wa

Re: [patch 1/2] powerpc: rmb fix

2007-08-23 Thread Nick Piggin
On Thu, Aug 23, 2007 at 07:57:20PM +0200, Segher Boessenkool wrote: > >>The powerpc kernel needs to have full sync insns in every I/O > >>accessor in order to enforce all the ordering rules Linux demands. > >>It's a bloody shame, but the alternative would be to make the > >>barriers lots more expen

Re: wmb vs mmiowb

2007-08-23 Thread Nick Piggin
On Thu, Aug 23, 2007 at 09:16:42AM -0700, Linus Torvalds wrote: > > > On Thu, 23 Aug 2007, Nick Piggin wrote: > > > > Also, FWIW, there are some advantages of deferring the mmiowb thingy > > until the point of unlock. > > And that is exactly what ppc64 does. &g

Re: wmb vs mmiowb

2007-08-23 Thread Nick Piggin
On Thu, Aug 23, 2007 at 09:56:16AM -0700, Jesse Barnes wrote: > On Thursday, August 23, 2007 12:27 am Benjamin Herrenschmidt wrote: > > > Of course, the normal memory barrier would usually be a > > > "spin_unlock()" or something like that, not a "wmb()". In fact, I > > > don't think the powerpc imp

Re: wmb vs mmiowb

2007-08-23 Thread Nick Piggin
On Thu, Aug 23, 2007 at 06:27:42PM +0200, Benjamin Herrenschmidt wrote: > On Thu, 2007-08-23 at 09:16 -0700, Linus Torvalds wrote: > > > > On Thu, 23 Aug 2007, Nick Piggin wrote: > > > > > > Also, FWIW, there are some advantages of deferring the mmiowb thing

Re: wmb vs mmiowb

2007-08-28 Thread Nick Piggin
On Tue, Aug 28, 2007 at 03:56:28PM -0500, Brent Casavant wrote: > On Fri, 24 Aug 2007, Nick Piggin wrote: > > > And all platforms other than sn2 don't appear to reorder IOs after > > they leave the CPU, so only sn2 needs to do the mmiowb thing before > > spin_unl

Re: wmb vs mmiowb

2007-08-29 Thread Nick Piggin
On Wed, Aug 29, 2007 at 01:53:53PM -0500, Brent Casavant wrote: > On Wed, 29 Aug 2007, Nick Piggin wrote: > > > On Tue, Aug 28, 2007 at 03:56:28PM -0500, Brent Casavant wrote: > > > > The simplistic method to solve this is a lock around the section > > &

Re: wmb vs mmiowb

2007-09-03 Thread Nick Piggin
On Thu, Aug 30, 2007 at 02:42:41PM -0500, Brent Casavant wrote: > On Thu, 30 Aug 2007, Nick Piggin wrote: > > > I don't know whether this is exactly a correct implementation of > > Linux's barrier semantics. On one hand, wmb _is_ ordering the stores > > as they

Re: SYSFS: need a noncaching read

2007-09-12 Thread Nick Piggin
On Wednesday 12 September 2007 20:01, Greg KH wrote: > On Wed, Sep 12, 2007 at 07:32:07AM +0200, Robert Schwebel wrote: > > On Tue, Sep 11, 2007 at 11:43:17AM +0200, Heiko Schocher wrote: > > > I have developed a device driver and use the sysFS to export some > > > registers to userspace. > > > > U

Re: [PATCH 0/6] 16G and multi size hugetlb page support on powerpc

2008-05-13 Thread Nick Piggin
On Tue, May 13, 2008 at 12:07:15PM -0500, Jon Tollefson wrote: > This patch set builds on Nick Piggin's patches for multi size and giant > hugetlb page support of April 22. The following set of patches adds > support for 16G huge pages on ppc64 and support for multiple huge page > sizes at the

Re: [patch 4/4] spufs: convert nopfn to fault

2008-05-14 Thread Nick Piggin
n let the subsequent non trivial patches filter up in their own time. I don't know, just a heads up. On Wed, May 14, 2008 at 04:12:54PM -0700, Andrew Morton wrote: > From: Nick Piggin <[EMAIL PROTECTED]> > > spufs: convert nopfn to fault > > Signed-off-by: Nick Piggin

[patch 1/2] powerpc: rmb fix

2008-05-21 Thread Nick Piggin
pears to be the only barrier which fits the bill. Signed-off-by: Nick Piggin <[EMAIL PROTECTED]> --- Index: linux-2.6/include/asm-powerpc/system.h === --- linux-2.6.orig/include/asm-powerpc/system.h +++ linux-2.6/include/asm-power

[patch 2/2] powerpc: optimise smp_wmb

2008-05-21 Thread Nick Piggin
lwsync is the recommended method of store/store ordering on caching enabled memory. For those subarchs which have lwsync, use it rather than eieio for smp_wmb. Signed-off-by: Nick Piggin <[EMAIL PROTECTED]> --- Index: linux-2.6/include/asm-powerpc/sy

Re: [patch 1/2] powerpc: rmb fix

2008-05-21 Thread Nick Piggin
On Wed, May 21, 2008 at 11:27:03AM -0400, Benjamin Herrenschmidt wrote: > > On Wed, 2008-05-21 at 16:10 +0200, Nick Piggin wrote: > > Hi, > > > > I'm sure I've sent these patches before, but I can't remember why they > > weren't merged. They

Re: [patch 2/2] powerpc: optimise smp_wmb

2008-05-21 Thread Nick Piggin
On Wed, May 21, 2008 at 11:26:32AM -0400, Benjamin Herrenschmidt wrote: > > On Wed, 2008-05-21 at 16:12 +0200, Nick Piggin wrote: > > lwsync is the recommended method of store/store ordering on caching enabled > > memory. For those subarchs which have lwsync, use it rat

Re: [patch 2/2] powerpc: optimise smp_wmb

2008-05-21 Thread Nick Piggin
On Wed, May 21, 2008 at 11:43:00AM -0400, Benjamin Herrenschmidt wrote: > > On Wed, 2008-05-21 at 17:34 +0200, Nick Piggin wrote: > > On Wed, May 21, 2008 at 11:26:32AM -0400, Benjamin Herrenschmidt wrote: > > > > > > On Wed, 2008-05-21 at 16:12 +0200, Nick Piggi

Re: [patch 2/2] powerpc: optimise smp_wmb

2008-05-21 Thread Nick Piggin
On Wed, May 21, 2008 at 11:43:00AM -0400, Benjamin Herrenschmidt wrote: > > On Wed, 2008-05-21 at 17:34 +0200, Nick Piggin wrote: > > On Wed, May 21, 2008 at 11:26:32AM -0400, Benjamin Herrenschmidt wrote: > > > > > > On Wed, 2008-05-21 at 16:12 +0200, Nick Piggi

Re: [patch 2/2] powerpc: optimise smp_wmb

2008-05-21 Thread Nick Piggin
On Wed, May 21, 2008 at 10:12:03PM +0200, Segher Boessenkool wrote: > >>From memory, I measured lwsync is 5 times faster than eieio on > >a dual G5. This was on a simple microbenchmark that made use of > >smp_wmb for store ordering, but it did not involve any IO access > >(which presumably would di

Re: [patch 1/2] powerpc: rmb fix

2008-05-22 Thread Nick Piggin
On Fri, May 23, 2008 at 12:14:41PM +1000, Paul Mackerras wrote: > Nick Piggin writes: > > > More than one device driver does raw/relaxed io accessors and expects the > > *mb functions to order them. > > Can you point us at an example? Uh, I might be getting confused b

Re: [patch 1/2] powerpc: rmb fix

2008-05-22 Thread Nick Piggin
On Fri, May 23, 2008 at 02:53:21PM +1000, Paul Mackerras wrote: > Nick Piggin writes: > > > There don't seem to actually be read*_relaxed calls that also use rmb > > in the same file (although there is no reason why they might not appear). > > But I must be thinking

Re: [PATCH 1/6 v2] allow arch specific function for allocating gigantic pages

2008-05-22 Thread Nick Piggin
On Tue, May 13, 2008 at 12:19:36PM -0500, Jon Tollefson wrote: > Allow alloc_bm_huge_page() to be overridden by architectures that can't > always use bootmem. This requires huge_boot_pages to be available for > use by this function. The 16G pages on ppc64 have to be reserved prior > to boot-time. T

Re: [patch 1/2] powerpc: rmb fix

2008-05-25 Thread Nick Piggin
On Fri, May 23, 2008 at 04:40:21PM +1000, Paul Mackerras wrote: > Nick Piggin writes: > > > Anyway, even if there were zero, then the point is still that you > > implement that API, so you should either strongly order your > > __raw_ and _relaxed then you can weaken

Re: MMIO and gcc re-ordering issue

2008-06-02 Thread Nick Piggin
On Monday 02 June 2008 19:56, Jes Sorensen wrote: > Jeremy Higdon wrote: > > We don't actually have that problem on the Altix. All writes issued > > by CPU X will be ordered with respect to each other. But writes by > > CPU X and CPU Y will not be, unless an mmiowb() is done by the > > original C

Re: MMIO and gcc re-ordering issue

2008-06-02 Thread Nick Piggin
On Monday 02 June 2008 17:24, Russell King wrote: > On Tue, May 27, 2008 at 02:55:56PM -0700, Linus Torvalds wrote: > > On Wed, 28 May 2008, Benjamin Herrenschmidt wrote: > > > A problem with __raw_ though is that they -also- don't do byteswap, > > > > Well, that's why there is __readl() and __raw_

Re: MMIO and gcc re-ordering issue

2008-06-02 Thread Nick Piggin
On Tuesday 03 June 2008 14:32, Benjamin Herrenschmidt wrote: > > This whole thread also ties in with my posts about mmiowb (which IMO > > should go away). > > > > readl/writel: strongly ordered wrt one another and other stores > >to cacheable RAM, byteswapping > > __readl/__writel:

Re: MMIO and gcc re-ordering issue

2008-06-03 Thread Nick Piggin
On Tuesday 03 June 2008 18:15, Jeremy Higdon wrote: > On Tue, Jun 03, 2008 at 02:33:11PM +1000, Nick Piggin wrote: > > On Monday 02 June 2008 19:56, Jes Sorensen wrote: > > > Would we be able to use Ben's trick of setting a per cpu flag in > > > writel() then

Re: MMIO and gcc re-ordering issue

2008-06-03 Thread Nick Piggin
On Tuesday 03 June 2008 16:53, Paul Mackerras wrote: > Nick Piggin writes: > > So your readl can pass an earlier cacheable store or earlier writel? > > No. It's quite gross at the moment, it has a sync before the access > (i.e. a full mb()) and a twi; isync sequence after t

Re: MMIO and gcc re-ordering issue

2008-06-03 Thread Nick Piggin
ho wrote: > >>>> On Tue, 3 Jun 2008, Linus Torvalds wrote: > >>>>> On Tue, 3 Jun 2008, Nick Piggin wrote: > >>>>>> Linus: on x86, memory operations to wc and wc+ memory are not > >>>>>> ordered with one another, or operation

Re: MMIO and gcc re-ordering issue

2008-06-03 Thread Nick Piggin
On Wednesday 04 June 2008 05:07, Linus Torvalds wrote: > On Tue, 3 Jun 2008, Trent Piepho wrote: > > On Tue, 3 Jun 2008, Linus Torvalds wrote: > > > On Tue, 3 Jun 2008, Nick Piggin wrote: > > > > Linus: on x86, memory operations to wc and wc+ memory are not ordere

Re: MMIO and gcc re-ordering issue

2008-06-03 Thread Nick Piggin
On Wednesday 04 June 2008 00:47, Linus Torvalds wrote: > On Tue, 3 Jun 2008, Nick Piggin wrote: > > Linus: on x86, memory operations to wc and wc+ memory are not ordered > > with one another, or operations to other memory types (ie. load/load > > and store/store reordering

Re: MMIO and gcc re-ordering issue

2008-06-03 Thread Nick Piggin
On Wednesday 04 June 2008 07:44, Trent Piepho wrote: > On Tue, 3 Jun 2008, Matthew Wilcox wrote: > > I don't understand why you keep talking about DMA. Are you talking > > about ordering between readX() and DMA? PCI proides those guarantees. > > I guess you haven't been reading the whole thread.

Re: MMIO and gcc re-ordering issue

2008-06-09 Thread Nick Piggin
On Wednesday 04 June 2008 05:07, Linus Torvalds wrote: > On Tue, 3 Jun 2008, Trent Piepho wrote: > > On Tue, 3 Jun 2008, Linus Torvalds wrote: > > > On Tue, 3 Jun 2008, Nick Piggin wrote: > > > > Linus: on x86, memory operations to wc and wc+ memory are not ordere

Re: MMIO and gcc re-ordering issue

2008-06-10 Thread Nick Piggin
On Wednesday 11 June 2008 05:19, Jesse Barnes wrote: > On Tuesday, June 10, 2008 12:05 pm Roland Dreier wrote: > > > me too. That's the whole basis for readX_relaxed() and its cohorts: > > > we make our weirdest machines (like altix) conform to the x86 norm. > > > Then where it really kills us

Re: MMIO and gcc re-ordering issue

2008-06-10 Thread Nick Piggin
On Wednesday 11 June 2008 13:40, Benjamin Herrenschmidt wrote: > On Wed, 2008-06-11 at 13:29 +1000, Nick Piggin wrote: > > Exactly, yes. I guess everybody has had good intentions here, but > > as noticed, what is lacking is coordination and documentation. > > > > You

Re: MMIO and gcc re-ordering issue

2008-06-10 Thread Nick Piggin
On Wednesday 11 June 2008 14:18, Paul Mackerras wrote: > Nick Piggin writes: > > OK, I'm sitll not quite sure where this has ended up. I guess you are > > happy with x86 semantics as they are now. That is, all IO accesses are > > strongly ordered WRT one another and W

Re: MMIO and gcc re-ordering issue

2008-06-10 Thread Nick Piggin
On Wednesday 11 June 2008 15:13, Paul Mackerras wrote: > Nick Piggin writes: > > > I just wish we had even one actual example of things going wrong with > > > the current rules we have on powerpc to motivate changing to this > > > model. > > > > ~/us

Re: MMIO and gcc re-ordering issue

2008-06-10 Thread Nick Piggin
On Wednesday 11 June 2008 15:35, Nick Piggin wrote: > On Wednesday 11 June 2008 15:13, Paul Mackerras wrote: > > Nick Piggin writes: > > > > I just wish we had even one actual example of things going wrong with > > > > the current rules we have on powerpc to motiva

  1   2   >