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

2009-01-08 Thread Gregory Haskins
Ingo Molnar wrote: > * Peter Zijlstra wrote: > > >> * WOW * >> > > WOW indeed - and i can see a similar _brutal_ speedup on two separate > 16-way boxes as well: > > 16 CPUs, running 128 parallel test-tasks. > > NO_OWNER_SPIN: > avg ops/sec: 281595 > > OWNER_SPIN: >

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

2009-01-07 Thread Gregory Haskins
Steven Rostedt wrote: > On Wed, 7 Jan 2009, Gregory Haskins wrote: > >> In my defense, the -rt versions of the patches guarantee this is ok >> based on a little hack: >> > > The -rt versions worry about much more than what the mutex code in > mainl

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

2009-01-07 Thread Gregory Haskins
[resend: restore CC list] >>> Linus Torvalds 01/07/09 6:33 PM >>> >On Wed, 7 Jan 2009, Steven Rostedt wrote: >> >> What would be interesting is various benchmarks against all three. >> >> 1) no mutex spinning. >> 2) get_task_struct() implementation. >> 3) spin_or_sched implementation. > >One of

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

2009-01-07 Thread Gregory Haskins
[resend: i fat fingered the reply-to-all for a few messages] >>> Linus Torvalds 01/07/09 6:20 PM >>> >On Wed, 7 Jan 2009, Linus Torvalds wrote: >> > >> > "Is get_task_struct() really that bad?" >> >> Yes. It's an atomic access (two, in fact, since you need to release it >> too), which is a huge

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

2009-01-07 Thread Gregory Haskins
Hi Ingo, Ingo Molnar wrote: > * Gregory Haskins wrote: > > >> Can I ask a simple question in light of all this discussion? >> >> "Is get_task_struct() really that bad?" >> > > it dirties a cacheline and it also involves atomics. >

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

2009-01-07 Thread Gregory Haskins
Andi Kleen wrote: >> I appreciate this is sample code, but using __get_user() on >> non-userspace pointers messes up architectures which have separate >> user/kernel spaces (eg the old 4G/4G split for x86-32). Do we have an >> appropriate function for kernel space pointers? >> > > probe_kern

Re: [PATCH][RFC]: mutex: adaptive spin

2009-01-06 Thread Gregory Haskins
Peter Zijlstra wrote: > On Tue, 2009-01-06 at 14:16 +0100, Ingo Molnar wrote: > >> * Gregory Haskins wrote: >> >> >>> Ingo Molnar wrote: >>> >>>> There's no time or spin-rate based heuristics in this

Re: [PATCH][RFC]: mutex: adaptive spin

2009-01-06 Thread Gregory Haskins
Ingo Molnar wrote: > There's no time or spin-rate based heuristics in this at all (i.e. these > mutexes are not 'adaptive' at all!), FYI: The original "adaptive" name was chosen in the -rt implementation to reflect that the locks can adaptively spin or sleep, depending on conditions. I realize t