Re: [PATCH -v9][RFC] mutex: implement adaptive spinning

2009-01-14 Thread Dmitry Adamushko
2009/1/14 Chris Mason : > On Wed, 2009-01-14 at 12:18 +0100, Dmitry Adamushko wrote: >> 2009/1/14 Chris Mason : >> > On Tue, 2009-01-13 at 18:21 +0100, Peter Zijlstra wrote: >> >> On Tue, 2009-01-13 at 08:49 -0800, Linus Torvalds wrote: >> >> > >> >> > So do a v10, and ask people to test. >> >> >>

Re: [PATCH -v9][RFC] mutex: implement adaptive spinning

2009-01-14 Thread Chris Mason
On Wed, 2009-01-14 at 12:18 +0100, Dmitry Adamushko wrote: > 2009/1/14 Chris Mason : > > On Tue, 2009-01-13 at 18:21 +0100, Peter Zijlstra wrote: > >> On Tue, 2009-01-13 at 08:49 -0800, Linus Torvalds wrote: > >> > > >> > So do a v10, and ask people to test. > >> > >> --- > >> Subject: mutex: imple

Re: [PATCH -v9][RFC] mutex: implement adaptive spinning

2009-01-14 Thread Chris Mason
On Wed, 2009-01-14 at 07:43 -0800, Linus Torvalds wrote: > > On Wed, 14 Jan 2009, Ingo Molnar wrote: > > > > > * Chris Mason wrote: > > > > > v10 is better that not spinning, but its in the 5-10% range. So, I've > > > been trying to find ways to close the gap, just to understand exactly > >

Re: [PATCH -v9][RFC] mutex: implement adaptive spinning

2009-01-14 Thread Linus Torvalds
On Wed, 14 Jan 2009, Ingo Molnar wrote: > > * Chris Mason wrote: > > > v10 is better that not spinning, but its in the 5-10% range. So, I've > > been trying to find ways to close the gap, just to understand exactly > > where it is different. > > > > If I take out: > > /* > > * If

Re: [PATCH -v9][RFC] mutex: implement adaptive spinning

2009-01-14 Thread Ingo Molnar
* Chris Mason wrote: > v10 is better that not spinning, but its in the 5-10% range. So, I've > been trying to find ways to close the gap, just to understand exactly > where it is different. > > If I take out: > /* >* If there are pending waiters, join them. >*/ >

Re: [PATCH -v9][RFC] mutex: implement adaptive spinning

2009-01-14 Thread Dmitry Adamushko
2009/1/14 Chris Mason : > On Tue, 2009-01-13 at 18:21 +0100, Peter Zijlstra wrote: >> On Tue, 2009-01-13 at 08:49 -0800, Linus Torvalds wrote: >> > >> > So do a v10, and ask people to test. >> >> --- >> Subject: mutex: implement adaptive spinning >> From: Peter Zijlstra >> Date: Mon Jan 12 14:01:4

Re: [PATCH -v9][RFC] mutex: implement adaptive spinning

2009-01-13 Thread Chris Mason
On Tue, 2009-01-13 at 18:21 +0100, Peter Zijlstra wrote: > On Tue, 2009-01-13 at 08:49 -0800, Linus Torvalds wrote: > > > > So do a v10, and ask people to test. > > --- > Subject: mutex: implement adaptive spinning > From: Peter Zijlstra > Date: Mon Jan 12 14:01:47 CET 2009 > > Change mutex con

Re: [PATCH -v9][RFC] mutex: implement adaptive spinning

2009-01-13 Thread Ingo Molnar
* Linus Torvalds wrote: > > > On Tue, 13 Jan 2009, Ingo Molnar wrote: > > > > below is the v8 -> v10 delta patch - for all who'd like to review the > > changes. > > Hmm. This does seem to indicate that v10 lost many of the preempt > changes. Probably because Peter went back to v7 to create

Re: [PATCH -v9][RFC] mutex: implement adaptive spinning

2009-01-13 Thread Linus Torvalds
On Tue, 13 Jan 2009, Ingo Molnar wrote: > > below is the v8 -> v10 delta patch - for all who'd like to review the > changes. Hmm. This does seem to indicate that v10 lost many of the preempt changes. Probably because Peter went back to v7 to create it. I also wonder about the timing numbers

Re: [PATCH -v9][RFC] mutex: implement adaptive spinning

2009-01-13 Thread Ingo Molnar
* Peter Zijlstra wrote: > On Tue, 2009-01-13 at 08:49 -0800, Linus Torvalds wrote: > > > > So do a v10, and ask people to test. below is the v8 -> v10 delta patch - for all who'd like to review the changes. Ingo > >From d154179e2d4d4667bcbf22920eeab563bc042e6a Mon Sep 17

Re: [PATCH -v9][RFC] mutex: implement adaptive spinning

2009-01-13 Thread Ingo Molnar
* Linus Torvalds wrote: > On Tue, 13 Jan 2009, Ingo Molnar wrote: > > > > And v8 is rock solid in all my testing - and i'll give v10 a similar > > workout as well. > > The differences between v8 and v10 are very fundamental, since v8 does > the spinning inside the spinlock'ed loop (the spinni

Re: [PATCH -v9][RFC] mutex: implement adaptive spinning

2009-01-13 Thread Linus Torvalds
On Tue, 13 Jan 2009, Ingo Molnar wrote: > > And v8 is rock solid in all my testing - and i'll give v10 a similar > workout as well. The differences between v8 and v10 are very fundamental, since v8 does the spinning inside the spinlock'ed loop (the spinning itself is not inside the spinlock,

Re: [PATCH -v9][RFC] mutex: implement adaptive spinning

2009-01-13 Thread Ingo Molnar
* Linus Torvalds wrote: > > > On Tue, 13 Jan 2009, Peter Zijlstra wrote: > > > > Ok, tested only 1, but that was the one I remember lockups from -- and > > that seems to be good with the cmpxchg. > > > > Do you fancy me sending v10 or will you make that change locally? > > I'd like to get t

Re: [PATCH -v9][RFC] mutex: implement adaptive spinning

2009-01-13 Thread Peter Zijlstra
On Tue, 2009-01-13 at 08:49 -0800, Linus Torvalds wrote: > > So do a v10, and ask people to test. --- Subject: mutex: implement adaptive spinning From: Peter Zijlstra Date: Mon Jan 12 14:01:47 CET 2009 Change mutex contention behaviour such that it will sometimes busy wait on acquisition - movi

Re: [PATCH -v9][RFC] mutex: implement adaptive spinning

2009-01-13 Thread Linus Torvalds
On Tue, 13 Jan 2009, Peter Zijlstra wrote: > > Ok, tested only 1, but that was the one I remember lockups from -- and > that seems to be good with the cmpxchg. > > Do you fancy me sending v10 or will you make that change locally? I'd like to get this in, but I'm not going to apply it in any ca

Re: [PATCH -v9][RFC] mutex: implement adaptive spinning

2009-01-13 Thread Peter Zijlstra
On Tue, 2009-01-13 at 17:21 +0100, Peter Zijlstra wrote: > On Tue, 2009-01-13 at 08:16 -0800, Linus Torvalds wrote: > > > > On Tue, 13 Jan 2009, Peter Zijlstra wrote: > > > > > > Change mutex contention behaviour such that it will sometimes busy wait on > > > acquisition - moving its behaviour cl

Re: [PATCH -v9][RFC] mutex: implement adaptive spinning

2009-01-13 Thread Ingo Molnar
* Peter Zijlstra wrote: > > Now you're forcing the slow-path on unlock. Maybe it was intentional, > > maybe it wasn't. Did you perhaps mean > > > > if (atomic_cmpxchg(&lock->count, 1, 0) == 1) { > > > > here? I thought we agreed it was safe, if only because it should be > > equivalent to

Re: [PATCH -v9][RFC] mutex: implement adaptive spinning

2009-01-13 Thread Peter Zijlstra
On Tue, 2009-01-13 at 08:16 -0800, Linus Torvalds wrote: > > On Tue, 13 Jan 2009, Peter Zijlstra wrote: > > > > Change mutex contention behaviour such that it will sometimes busy wait on > > acquisition - moving its behaviour closer to that of spinlocks. > > Okey, dokey. Looks reasonable, but I

Re: [PATCH -v9][RFC] mutex: implement adaptive spinning

2009-01-13 Thread Linus Torvalds
On Tue, 13 Jan 2009, Peter Zijlstra wrote: > > Change mutex contention behaviour such that it will sometimes busy wait on > acquisition - moving its behaviour closer to that of spinlocks. Okey, dokey. Looks reasonable, but I wonder if this part came from v8 and wasn't intentional: > +

[PATCH -v9][RFC] mutex: implement adaptive spinning

2009-01-13 Thread Peter Zijlstra
Subject: mutex: implement adaptive spinning From: Peter Zijlstra Date: Mon Jan 12 14:01:47 CET 2009 Change mutex contention behaviour such that it will sometimes busy wait on acquisition - moving its behaviour closer to that of spinlocks. This concept got ported to mainline from the -rt tree, wh