2016-10-07 15:06:51

by Peter Zijlstra

[permalink] [raw]
Subject: [PATCH -v4 0/8] locking/mutex: Rewrite basic mutex


Hi all,

Since you all should not be sending patches during the merge window, I figured
I should to keep you all occupied with something.

Please review, test and otherwise try to break these here patches.

I would like to get these patches into -tip (and -next) once the merge window
closes, so please spend these quiet days staring at this stuff.

Small changes only, mostly the handoff logic as suggested by Waiman last time.


---
arch/alpha/include/asm/mutex.h | 9 -
arch/arc/include/asm/mutex.h | 18 -
arch/arm/include/asm/mutex.h | 21 --
arch/arm64/include/asm/Kbuild | 1 -
arch/avr32/include/asm/mutex.h | 9 -
arch/blackfin/include/asm/Kbuild | 1 -
arch/c6x/include/asm/mutex.h | 6 -
arch/cris/include/asm/mutex.h | 9 -
arch/frv/include/asm/mutex.h | 9 -
arch/h8300/include/asm/mutex.h | 9 -
arch/hexagon/include/asm/mutex.h | 8 -
arch/ia64/include/asm/mutex.h | 90 -----
arch/m32r/include/asm/mutex.h | 9 -
arch/m68k/include/asm/Kbuild | 1 -
arch/metag/include/asm/Kbuild | 1 -
arch/microblaze/include/asm/mutex.h | 1 -
arch/mips/include/asm/Kbuild | 1 -
arch/mn10300/include/asm/mutex.h | 16 -
arch/nios2/include/asm/mutex.h | 1 -
arch/openrisc/include/asm/mutex.h | 27 --
arch/parisc/include/asm/Kbuild | 1 -
arch/powerpc/include/asm/mutex.h | 132 -------
arch/s390/include/asm/mutex.h | 9 -
arch/score/include/asm/mutex.h | 6 -
arch/sh/include/asm/mutex-llsc.h | 109 ------
arch/sh/include/asm/mutex.h | 12 -
arch/sparc/include/asm/Kbuild | 1 -
arch/tile/include/asm/Kbuild | 1 -
arch/um/include/asm/Kbuild | 1 -
arch/unicore32/include/asm/mutex.h | 20 --
arch/x86/include/asm/mutex.h | 5 -
arch/x86/include/asm/mutex_32.h | 110 ------
arch/x86/include/asm/mutex_64.h | 127 -------
arch/xtensa/include/asm/mutex.h | 9 -
drivers/gpu/drm/i915/i915_gem_shrinker.c | 26 +-
drivers/gpu/drm/msm/msm_gem_shrinker.c | 23 +-
include/asm-generic/mutex-dec.h | 88 -----
include/asm-generic/mutex-null.h | 19 --
include/asm-generic/mutex-xchg.h | 120 -------
include/asm-generic/mutex.h | 9 -
include/linux/mutex-debug.h | 24 --
include/linux/mutex.h | 46 ++-
kernel/Kconfig.locks | 2 +-
kernel/locking/mutex-debug.c | 13 -
kernel/locking/mutex-debug.h | 10 -
kernel/locking/mutex.c | 569 ++++++++++++++++++-------------
kernel/locking/mutex.h | 26 --
kernel/sched/core.c | 2 +-
48 files changed, 364 insertions(+), 1403 deletions(-)


2016-10-07 15:41:57

by Linus Torvalds

[permalink] [raw]
Subject: Re: [PATCH -v4 0/8] locking/mutex: Rewrite basic mutex

On Fri, Oct 7, 2016 at 7:52 AM, Peter Zijlstra <[email protected]> wrote:
>
> Since you all should not be sending patches during the merge window, I figured
> I should to keep you all occupied with something.

Thanks.. I guess.

No real review of the code itself from me (I'll leave that to Waiman
and the usual gang), but I have to say that I like how it looks from
30000 ft. Getting rid of the arch-specific code is lovely.

Linus

2016-10-11 19:08:53

by Jason Low

[permalink] [raw]
Subject: Re: [PATCH -v4 0/8] locking/mutex: Rewrite basic mutex

On Fri, 2016-10-07 at 16:52 +0200, Peter Zijlstra wrote:
> Hi all,
>
> Since you all should not be sending patches during the merge window, I figured
> I should to keep you all occupied with something.
>
> Please review, test and otherwise try to break these here patches.
>
> I would like to get these patches into -tip (and -next) once the merge window
> closes, so please spend these quiet days staring at this stuff.
>
> Small changes only, mostly the handoff logic as suggested by Waiman last time.

I tested these new patches on the 8 socket system with the high_systime
workload which stresses mutexes.

The average throughput with and without the patches were very similar at
lower levels of contention. At high contention, the throughput with the
patches were slightly lower, but only by a small amount, which I think
is expected due to the additional waiter wait time, ect...

-------------------------------------------------
| users | avg throughput | avg throughput |
| without patch | with patch |
-------------------------------------------------
| 10 - 90 | 13,989 JPM | 13,920 JPM |
-------------------------------------------------
| 100 - 900 | 76,362 JPM | 76,298 JPM |
-------------------------------------------------
| 1000 - 1900 | 77,146 JPM | 76,061 JPM |
-------------------------------------------------

Tested-by: Jason Low <[email protected]>