Re: [rfc] optimise unlock_page

2007-05-16 Thread Nick Piggin
On Wed, May 16, 2007 at 12:47:54PM -0700, Linus Torvalds wrote: > > On Wed, 16 May 2007, Hugh Dickins wrote: > > > > The other option of moving the bit into ->mapping hopefully avoids all > > > the issues, and would probably be a little faster again on the P4, at the > > > expense of being a more

Re: [rfc] optimise unlock_page

2007-05-16 Thread Linus Torvalds
On Wed, 16 May 2007, Hugh Dickins wrote: > On Wed, 16 May 2007, Nick Piggin wrote: > > On Wed, May 16, 2007 at 06:54:15PM +0100, Hugh Dickins wrote: > > > On Sun, 13 May 2007, Nick Piggin wrote: > > > > > > > > Well I think so, but not completely sure. > > > > > > That's not quite enough to co

Re: [rfc] optimise unlock_page

2007-05-16 Thread Hugh Dickins
On Wed, 16 May 2007, Nick Piggin wrote: > On Wed, May 16, 2007 at 06:54:15PM +0100, Hugh Dickins wrote: > > On Sun, 13 May 2007, Nick Piggin wrote: > > > > > > Well I think so, but not completely sure. > > > > That's not quite enough to convince me! > > I did ask Linus, and he was very sure it w

Re: [rfc] optimise unlock_page

2007-05-16 Thread Nick Piggin
On Wed, May 16, 2007 at 06:54:15PM +0100, Hugh Dickins wrote: > On Sun, 13 May 2007, Nick Piggin wrote: > > On Sun, May 13, 2007 at 05:39:03AM +0100, Hugh Dickins wrote: > > > On Sun, 13 May 2007, Nick Piggin wrote: > > > > On Fri, May 11, 2007 at 02:15:03PM +0100, Hugh Dickins wrote: > > > > > >

Re: [rfc] optimise unlock_page

2007-05-16 Thread Hugh Dickins
On Sun, 13 May 2007, Nick Piggin wrote: > On Sun, May 13, 2007 at 05:39:03AM +0100, Hugh Dickins wrote: > > On Sun, 13 May 2007, Nick Piggin wrote: > > > On Fri, May 11, 2007 at 02:15:03PM +0100, Hugh Dickins wrote: > > > > > > > Hmm, well, I think that's fairly horrid, and would it even be > > >

Re: [rfc] optimise unlock_page

2007-05-16 Thread Nick Piggin
On Wed, May 16, 2007 at 06:21:09PM +0100, Hugh Dickins wrote: > On Sun, 13 May 2007, Nick Piggin wrote: > > On Fri, May 11, 2007 at 02:15:03PM +0100, Hugh Dickins wrote: > > > > > But again I wonder just what the gain has been, once your double > > > unmap_mapping_range is factored in. When I sug

Re: [rfc] optimise unlock_page

2007-05-16 Thread Hugh Dickins
On Sun, 13 May 2007, Nick Piggin wrote: > On Fri, May 11, 2007 at 02:15:03PM +0100, Hugh Dickins wrote: > > > But again I wonder just what the gain has been, once your double > > unmap_mapping_range is factored in. When I suggested before that > > perhaps the double (well, treble including the on

Re: [rfc] optimise unlock_page

2007-05-12 Thread Nick Piggin
On Sun, May 13, 2007 at 05:39:03AM +0100, Hugh Dickins wrote: > On Sun, 13 May 2007, Nick Piggin wrote: > > On Fri, May 11, 2007 at 02:15:03PM +0100, Hugh Dickins wrote: > > > > > Hmm, well, I think that's fairly horrid, and would it even be > > > guaranteed to work on all architectures? Playing

Re: [rfc] optimise unlock_page

2007-05-12 Thread Hugh Dickins
On Sun, 13 May 2007, Nick Piggin wrote: > On Fri, May 11, 2007 at 02:15:03PM +0100, Hugh Dickins wrote: > > > Hmm, well, I think that's fairly horrid, and would it even be > > guaranteed to work on all architectures? Playing with one char > > of an unsigned long in one way, while playing with the

Re: [rfc] optimise unlock_page

2007-05-12 Thread Nick Piggin
On Fri, May 11, 2007 at 02:15:03PM +0100, Hugh Dickins wrote: > On Fri, 11 May 2007, Nick Piggin wrote: > > > > Don't worry, I'm only just beginning ;) Can we then do something crazy > > like this? (working on x86-64 only, so far. It seems to eliminate > > lat_pagefault and lat_proc regressions h

Re: [rfc] optimise unlock_page

2007-05-11 Thread Hugh Dickins
On Fri, 11 May 2007, Nick Piggin wrote: > On Thu, May 10, 2007 at 08:14:52PM +0100, Hugh Dickins wrote: > > > > Well, on the x86_64 I have seen a few of your io_schedule_timeout > > printks under load; but suspect those are no fault of your changes, > > Hmm, I see... well I forgot to remove those

Re: [rfc] optimise unlock_page

2007-05-11 Thread Nick Piggin
On Thu, May 10, 2007 at 08:14:52PM +0100, Hugh Dickins wrote: > On Thu, 10 May 2007, Nick Piggin wrote: > > > > OK, I found a simple bug after pulling out my hair for a while :) > > With this, a 4-way system survives a couple of concurrent make -j250s > > quite nicely (wheras they eventually locke

Re: [rfc] optimise unlock_page

2007-05-10 Thread Hugh Dickins
On Thu, 10 May 2007, Nick Piggin wrote: > > OK, I found a simple bug after pulling out my hair for a while :) > With this, a 4-way system survives a couple of concurrent make -j250s > quite nicely (wheras they eventually locked up before). > > The problem is that the bit wakeup function did not g

Re: [rfc] optimise unlock_page

2007-05-09 Thread Nick Piggin
On Wed, May 09, 2007 at 08:33:15PM +0100, Hugh Dickins wrote: > > Not good enough, I'm afraid. It looks like Ben's right and you need > a count - and counts in the page struct are a lot harder to add than > page flags. > > I've now played around with the hangs on my three 4CPU machines > (all of

Re: [rfc] optimise unlock_page

2007-05-09 Thread Benjamin Herrenschmidt
> Not good enough, I'm afraid. It looks like Ben's right and you need > a count - and counts in the page struct are a lot harder to add than > page flags. > > I've now played around with the hangs on my three 4CPU machines > (all of them in io_schedule below __lock_page, waiting on pages > which

Re: [rfc] optimise unlock_page

2007-05-09 Thread Hugh Dickins
On Wed, 9 May 2007, Nick Piggin wrote: > On Wed, May 09, 2007 at 12:41:24AM +0200, Nick Piggin wrote: > > On Wed, May 09, 2007 at 07:30:27AM +1000, Benjamin Herrenschmidt wrote: > > > > > > Waking them all would fix it but at the risk of causing other > > > problems... Maybe PG_waiters need to act

Re: [rfc] optimise unlock_page

2007-05-08 Thread Nick Piggin
On Wed, May 09, 2007 at 12:41:24AM +0200, Nick Piggin wrote: > On Wed, May 09, 2007 at 07:30:27AM +1000, Benjamin Herrenschmidt wrote: > > On Tue, 2007-05-08 at 13:40 +0200, Nick Piggin wrote: > > > This patch trades a page flag for a significant improvement in the > > > unlock_page > > > fastpath

Re: [rfc] optimise unlock_page

2007-05-08 Thread Nick Piggin
On Wed, May 09, 2007 at 07:30:27AM +1000, Benjamin Herrenschmidt wrote: > On Tue, 2007-05-08 at 13:40 +0200, Nick Piggin wrote: > > This patch trades a page flag for a significant improvement in the > > unlock_page > > fastpath. Various problems in the previous version were spotted by Hugh and > >

Re: [rfc] optimise unlock_page

2007-05-08 Thread Nick Piggin
On Tue, May 08, 2007 at 01:13:35PM +0100, David Howells wrote: > > Nick Piggin <[EMAIL PROTECTED]> wrote: > > > This patch trades a page flag for a significant improvement in the > > unlock_page > > fastpath. Various problems in the previous version were spotted by Hugh and > > Ben (and fixed in

Re: [rfc] optimise unlock_page

2007-05-08 Thread Benjamin Herrenschmidt
On Tue, 2007-05-08 at 13:40 +0200, Nick Piggin wrote: > This patch trades a page flag for a significant improvement in the unlock_page > fastpath. Various problems in the previous version were spotted by Hugh and > Ben (and fixed in this one). > > Comments? > > -- > > Speed up unlock_page by int

Re: [rfc] optimise unlock_page

2007-05-08 Thread Hugh Dickins
On Tue, 8 May 2007, Nick Piggin wrote: > This patch trades a page flag for a significant improvement in the unlock_page > fastpath. Various problems in the previous version were spotted by Hugh and > Ben (and fixed in this one). > > Comments? Seems there's still a bug there. I get hangs on the

Re: [rfc] optimise unlock_page

2007-05-08 Thread David Howells
Nick Piggin <[EMAIL PROTECTED]> wrote: > This patch trades a page flag for a significant improvement in the unlock_page > fastpath. Various problems in the previous version were spotted by Hugh and > Ben (and fixed in this one). It looks reasonable at first glance, though it does consume yet ano