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 1 replyIn review

Changes since the previous version from the cover letter

- fixed the %eax clobber bug noticed by Linus. Also fixed a similar bug in the x86_64 assembly routine. Ended up solving this by marking the register clobbered - the function-always-returns change resulted in worse code. (usually the slowpath functions dont have the atomic-lock parameter ready at the end of the function, so they have to do extra work to return it.)

- implemented Oleg's suggestion of doing the xchg() before adding the waiter to the queue.

- optimization: in the xchg() case we can avoid hitting the slowpath when releasing the lock later on, by setting the count to 0 if the wait-list is otherwise empty. This is the common-case for wakeups.

- bugfix: forgot to take a spinlock in the signal-return path.

- added a couple of likely/unlikely modifiers, based on profile output.

- inline the trylock fastpath into the mutex_trylock() function.

- move the waiter->lock field into the debug path - nothing in the non-debug case was using it. This is also a small optimization for the slowpath.

- optimization: do a cheaper list_del in the non-debug case. This also enabled the removal of debug_remove_waiter().

- fix for the debugging branch: initialize the wait->list to empty.

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 -00 replies
3/8mutex subsystem, add atomic_*_call_if_*() to i386include/asm-i386/atomic.h+57 -00 replies
4/8mutex subsystem, add atomic_*_call_if_*() to x86_64include/asm-x86_64/atomic.h+58 -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+549 -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.

Changes since the previous version:

- fixed the %eax clobber bug noticed by Linus. Also fixed a similar bug in the x86_64 assembly routine. Ended up solving this by marking the register clobbered - the function-always-returns change resulted in worse code. (usually the slowpath functions dont have the atomic-lock parameter ready at the end of the function, so they have to do extra work to return it.)

- implemented Oleg's suggestion of doing the xchg() before adding the waiter to the queue.

- optimization: in the xchg() case we can avoid hitting the slowpath when releasing the lock later on, by setting the count to 0 if the wait-list is otherwise empty. This is the common-case for wakeups.

- bugfix: forgot to take a spinlock in the signal-return path.

- added a couple of likely/unlikely modifiers, based on profile output.

- inline the trylock fastpath into the mutex_trylock() function.

- move the waiter->lock field into the debug path - nothing in the non-debug case was using it. This is also a small optimization for the slowpath.

- optimization: do a cheaper list_del in the non-debug case. This also enabled the removal of debug_remove_waiter().

- fix for the debugging branch: initialize the wait->list to empty.

Ingo