diff options
author | John Stultz <johnstul@us.ibm.com> | 2010-02-22 16:48:26 -0800 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2010-04-27 17:32:58 +0200 |
commit | 23695896abe0d1c813c2c88f0dd165d435d08689 (patch) | |
tree | bc676786565c37a9dce4a8ca07d0a393e753f43c /include | |
parent | 3f2ef0d48b33d3423f99077a6efd6f4eea3ac090 (diff) | |
download | lwn-23695896abe0d1c813c2c88f0dd165d435d08689.tar.gz lwn-23695896abe0d1c813c2c88f0dd165d435d08689.zip |
Fix vfsmount_read_lock to work with -rt
Because vfsmount_read_lock aquires the vfsmount spinlock for the current cpu,
it causes problems wiht -rt, as you might migrate between cpus between a
lock and unlock.
This patch fixes the issue by having the caller pick a cpu, then consistently
use that cpu between the lock and unlock. We may migrate inbetween lock and
unlock, but that's ok because we're not doing anything cpu specific, other
then avoiding contention on the read side across the cpus.
Its not pretty, but it works and statistically shouldn't hurt performance.
Signed-off-by: John Stultz <johnstul@us.ibm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mount.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/mount.h b/include/linux/mount.h index e710a0e18d59..849e70535047 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h @@ -84,8 +84,8 @@ static inline int *get_mnt_writers_ptr(struct vfsmount *mnt) struct file; /* forward dec */ -extern void vfsmount_read_lock(void); -extern void vfsmount_read_unlock(void); +extern void vfsmount_read_lock(int cpu); +extern void vfsmount_read_unlock(int cpu); extern void vfsmount_write_lock(void); extern void vfsmount_write_unlock(void); |