Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

locking/Documentation: Update locking/mutex-design.txt disadvantages

Fortunately Jason was able to reduce some of the overhead we
had introduced in the original rwsem optimistic spinning -
an it is now the same size as mutexes. Update the documentation
accordingly.

Signed-off-by: Davidlohr Bueso <davidlohr@hp.com>
Acked-by: Jason Low <jason.low2@hp.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: aswin@hp.com
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Randy Dunlap <rdunlap@infradead.org>
Link: http://lkml.kernel.org/r/1406752916-3341-7-git-send-email-davidlohr@hp.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Davidlohr Bueso and committed by
Ingo Molnar
0a7cbf9a 214e0aed

+3 -3
+3 -3
Documentation/locking/mutex-design.txt
··· 145 145 146 146 Unlike its original design and purpose, 'struct mutex' is larger than 147 147 most locks in the kernel. E.g: on x86-64 it is 40 bytes, almost twice 148 - as large as 'struct semaphore' (24 bytes) and 8 bytes shy of the 149 - 'struct rw_semaphore' variant. Larger structure sizes mean more CPU 150 - cache and memory footprint. 148 + as large as 'struct semaphore' (24 bytes) and tied, along with rwsems, 149 + for the largest lock in the kernel. Larger structure sizes mean more 150 + CPU cache and memory footprint. 151 151 152 152 When to use mutexes 153 153 -------------------