Skip to content

mutex subsystem, ANNOUNCE

Ingo Molnar lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 24 repliesIn review

Changes since the previous version from the cover letter · 22 lines

- dropped the semaphore-renaming and migration-helper patches. The patches now contain only the pure mutex subsystem, nothing more.

- removed the fastpath dependency on __HAVE_ARCH_CMPXCHG: now every architecture is able to use the generic mutex_lock/mutex_unlock lockless fastpath. The quality of the fastpath is still as good as in the previous version.

- added ARCH_IMPLEMENTS_MUTEX_FASTPATH for architectures that want to hand-code their own fastpath. The mutex_lock_slowpath, mutex_unlock_slowpath and mutex_lock_interruptible_slowpath global functions can be used by such architectures in this case, and they should implement the mutex_lock(), mutex_unlock() and mutex_lock_interruptible() functions themselves. I have tested this mechanism on x86. (but x86 wants to use the generic functions otherwise, so those changes are not included in this patchqueue.)

- fixed the x86_64 register-clobber bug noticed by Zwane Mwaikambo

- XFS namespace collision fixes from Jes Sorensen

- lots of cleanups to "hide" the debugging code, it should now be much less intrusive visually - kernel/mutex.c is now both smaller and easier to read. There's no reduction in debugging functionality.

- cleaned up the debugging code

- unified all the externally visible debugging functions around the mutex_debug_ prefix.

- added the proper atomic ops to every architecture - so in theory mutexes should now work on every architectures. i386, x86_64 and ia64 was tested.

- created mutex-debug.h to hide some of the debugging details. Moved the mm.h and sched.h debug-function declarations into this file.

- documentation updates

- eliminated the ->file, ->line debugging variant - __FUNCTION__ is good enough and resulted in nicer code.

- properly check for held locks in kfree() too, if DEBUG.

- check for held-lock reinitialization via mutex_init(), if DEBUG.

- more micro-optimizations: eliminated an extra spinlock drop/reacquire in the slowpath.

- dropped waiter->woken, profiles showed that it triggered very rarely.

- dropped the timeout/timer bits - nothing is using them right now, we can add them back later.

- new mutex_trylock() optimization on architectures that support cmpxchg.

- marked ->name as const

- fixed typo: CONFIG_DEBUG_MUTEXESS -> CONFIG_DEBUG_MUTEXES

- mb() -> smp_mb() in mutex_is_locked()

- mutex_trylock doesnt need __sched

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/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 -521 reply
2/8mutex subsystem, add atomic_cmpxchg() to all archesinclude/asm-alpha/atomic.h include/asm-arm/atomic.h include/asm-arm26/atomic.h +19 more+29 -02 replies
3/8mutex subsystem, add atomic_*_call_if_*() to i386include/asm-i386/atomic.h+55 -08 replies
4/8mutex subsystem, add atomic_*_call_if_*() to x86_64include/asm-x86_64/atomic.h+56 -00 replies
5/8mutex subsystem, add atomic_*_call_if_*() defaults to the remaining archesinclude/asm-alpha/atomic.h include/asm-arm/atomic.h include/asm-arm26/atomic.h +18 more+269 -00 replies
6/8mutex subsystem, coreinclude/linux/mutex.h kernel/Makefile kernel/mutex.c+554 -10 replies
7/8mutex subsystem, debugging codeinclude/linux/mutex-debug.h include/linux/sched.h kernel/fork.c +2 more+545 -00 replies
8/8mutex subsystem, more debugging codearch/i386/mm/pageattr.c drivers/char/sysrq.c include/linux/mm.h +5 more+47 -80 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, ANNOUNCE

this is the latest version of the mutex subsystem patch-queue. It consists of the following patches:

xfs-mutex-namespace-collision-fix.patch
add-atomic-xchg.patch
add-atomic-call-func-i386.patch
add-atomic-call-func-x86_64.patch
add-atomic-call-wrappers-rest.patch
mutex-core.patch
mutex-debug.patch
mutex-debug-more.patch

the patches are against Linus' latest tree, and were tested on i386, x86_64 and ia64. [the tests were also done in DEBUG_MUTEX_FULL mode, to make sure the code works fine. MUTEX_FULL support is not included in this patchqueue].

The patches can also be downloaded from:

http://redhat.com/~mingo/generic-mutex-subsystem/

Changes since the previous version:

- dropped the semaphore-renaming and migration-helper patches. The patches now contain only the pure mutex subsystem, nothing more.

- removed the fastpath dependency on __HAVE_ARCH_CMPXCHG: now every architecture is able to use the generic mutex_lock/mutex_unlock lockless fastpath. The quality of the fastpath is still as good as in the previous version.

- added ARCH_IMPLEMENTS_MUTEX_FASTPATH for architectures that want to hand-code their own fastpath. The mutex_lock_slowpath, mutex_unlock_slowpath and mutex_lock_interruptible_slowpath global functions can be used by such architectures in this case, and they should implement the mutex_lock(), mutex_unlock() and mutex_lock_interruptible() functions themselves. I have tested this mechanism on x86. (but x86 wants to use the generic functions otherwise, so those changes are not included in this patchqueue.)

- fixed the x86_64 register-clobber bug noticed by Zwane Mwaikambo

- XFS namespace collision fixes from Jes Sorensen

- lots of cleanups to "hide" the debugging code, it should now be much less intrusive visually - kernel/mutex.c is now both smaller and easier to read. There's no reduction in debugging functionality.

- cleaned up the debugging code

- unified all the externally visible debugging functions around the mutex_debug_ prefix.

- added the proper atomic ops to every architecture - so in theory mutexes should now work on every architectures. i386, x86_64 and ia64 was tested.

- created mutex-debug.h to hide some of the debugging details. Moved the mm.h and sched.h debug-function declarations into this file.

- documentation updates

- eliminated the ->file, ->line debugging variant - __FUNCTION__ is good enough and resulted in nicer code.

- properly check for held locks in kfree() too, if DEBUG.

- check for held-lock reinitialization via mutex_init(), if DEBUG.

- more micro-optimizations: eliminated an extra spinlock drop/reacquire in the slowpath.

- dropped waiter->woken, profiles showed that it triggered very rarely.

- dropped the timeout/timer bits - nothing is using them right now, we can add them back later.

- new mutex_trylock() optimization on architectures that support cmpxchg.

- marked ->name as const

- fixed typo: CONFIG_DEBUG_MUTEXESS -> CONFIG_DEBUG_MUTEXES

- mb() -> smp_mb() in mutex_is_locked()

- mutex_trylock doesnt need __sched

comments, fixes, bugreports are welcome,

Ingo