Skip to content

mutex subsystem, -V6

Ingo Molnar lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8mutex subsystem, add atomic_xchg() to all archesinclude/asm-alpha/atomic.h include/asm-arm/atomic.h include/asm-arm26/atomic.h +19 more+29 -00 replies
2/8mutex subsystem, add asm-generic/mutex-[dec|xchg].h implementationsinclude/asm-generic/mutex-dec.h include/asm-generic/mutex-xchg.h+137 -02 replies
3/8mutex subsystem, add per-arch mutex.h filesinclude/asm-alpha/mutex.h include/asm-arm/mutex.h include/asm-arm26/mutex.h +20 more+370 -00 replies
4/8mutex subsystem, coreinclude/linux/mutex.h kernel/Makefile kernel/mutex.c+620 -10 replies
5/8mutex subsystem, documentationDocumentation/mutex-design.txt+126 -00 replies
6/8mutex subsystem, debugging codeinclude/linux/mutex-debug.h include/linux/sched.h kernel/fork.c +2 more+565 -00 replies
7/8mutex subsystem, more debugging codearch/i386/mm/pageattr.c drivers/char/sysrq.c include/linux/mm.h +4 more+37 -00 replies
8/8mutex subsystem, XFS namespace collision fixesfs/xfs/linux-2.6/mutex.h fs/xfs/quota/xfs_dquot.c fs/xfs/quota/xfs_dquot.h +8 more+52 -520 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [patch 0/8] mutex subsystem, -V6

this is verion -V6 of the generic mutex subsystem. It consists of the following patches:

add-atomic-xchg.patch
mutex-generic-asm-implementations.patch
mutex-arch-mutex-h.patch
mutex-core.patch
mutex-docs.patch
mutex-debug.patch
mutex-debug-more.patch
xfs-mutex-namespace-collision-fix.patch

the patches are against Linus' latest GIT tree, and they should work fine on every Linux architecture.

the delta since -V5:

  53 files changed, 718 insertions(+), 454 deletions(-)

this release picks up Arjan's asm/mutex.h implementation, which adds asm-generic/mutex-dec.h, asm-generic/mutex-xchg.h for architectures to pick up. i386 and x86_64 use their own optimized version already, the other architectures default to mutex-xchg.h. Architectures specify the following functions:

-------------------------------------------------------------------
* __mutex_fastpath_lock - try to take the lock by moving the count
* from 1 to a 0 value
* @count: pointer of type atomic_t
* @fn: function to call if the original value was not 1
-------------------------------------------------------------------
* __mutex_fastpath_lock_retval - try to take the lock by moving the count
* from 1 to a 0 value
* @count: pointer of type atomic_t
* @fn: function to call if the original value was not 1
-------------------------------------------------------------------

 *  __mutex_fastpath_unlock - try to promote the mutex from 0 to 1
 *  @count: pointer of type atomic_t
 *  @fn: function to call if the original value was not 1

-------------------------------------------------------------------

and __mutex_slowpath_needs_to_unlock(), to specify whether the fastpath has touched the count or not.

i have tested this on x86, and i have booted all 4 variants:
mutex-xchg.h, mutex-dec.h, asm-i386/mutex.h and the debug version. (in MUTEX_DEBUG_FULL mode, i.e. with the mutexes in real use.)

Nico, Christoph, does this approach work for you? Nico, you might want to try an ARM-specific mutex.h implementation.

Ingo