https://github.com/torvalds/linux
Revision 2a4419b5b2a77f3f4537c14f7ad7df95770655dd authored by Nick Piggin on 17 August 2010, 18:37:33 UTC, committed by Al Viro on 18 August 2010, 12:35:46 UTC
fs: fs_struct rwlock to spinlock

struct fs_struct.lock is an rwlock with the read-side used to protect root and
pwd members while taking references to them. Taking a reference to a path
typically requires just 2 atomic ops, so the critical section is very small.
Parallel read-side operations would have cacheline contention on the lock, the
dentry, and the vfsmount cachelines, so the rwlock is unlikely to ever give a
real parallelism increase.

Replace it with a spinlock to avoid one or two atomic operations in typical
path lookup fastpath.

Signed-off-by: Nick Piggin <npiggin@kernel.dk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 44672e4
History
Tip revision: 2a4419b5b2a77f3f4537c14f7ad7df95770655dd authored by Nick Piggin on 17 August 2010, 18:37:33 UTC
fs: fs_struct rwlock to spinlock
Tip revision: 2a4419b
File Mode Size
Documentation
arch
block
crypto
drivers
firmware
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.gitignore -rw-r--r-- 936 bytes
.mailmap -rw-r--r-- 3.9 KB
COPYING -rw-r--r-- 18.3 KB
CREDITS -rw-r--r-- 91.8 KB
Kbuild -rw-r--r-- 2.4 KB
MAINTAINERS -rw-r--r-- 172.4 KB
Makefile -rw-r--r-- 50.5 KB
README -rw-r--r-- 17.0 KB
REPORTING-BUGS -rw-r--r-- 3.3 KB

README

back to top