diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2009-05-07 17:25:29 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2009-09-14 01:18:15 -0400 |
commit | d663af807d8bb226394cb7e02f4665f6141a8140 (patch) | |
tree | 56516a97cad01d589bb3da930459bfcd82c5d9d0 /include/linux/reiserfs_fs.h | |
parent | e43d3f21c502dec786f2885a75e25859f18d6ffa (diff) |
kill-the-bkl/reiserfs: conditionaly release the write lock on fs_changed()
The goal of fs_changed() is to check whether the tree changed during a
schedule(). This is a BKL legacy.
A recent patch added an explicit unconditional release/reacquire of the
write lock around the cond_resched() called inside fs_changed.
But it's wasteful to unconditionally do that, we are creating superfluous
lock contention in !TIF_NEED_RESCHED case.
This patch manage that by calling reiserfs_cond_resched() from fs_changed()
which only releases the lock if we are going to reschedule.
[ Impact: inject less lock contention and tree job retries ]
Cc: Jeff Mahoney <jeffm@suse.com>
Cc: Chris Mason <chris.mason@oracle.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'include/linux/reiserfs_fs.h')
-rw-r--r-- | include/linux/reiserfs_fs.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index 27f4ecc28180..508fb523863e 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -1348,9 +1348,7 @@ static inline loff_t max_reiserfs_offset(struct inode *inode) | |||
1348 | #define __fs_changed(gen,s) (gen != get_generation (s)) | 1348 | #define __fs_changed(gen,s) (gen != get_generation (s)) |
1349 | #define fs_changed(gen,s) \ | 1349 | #define fs_changed(gen,s) \ |
1350 | ({ \ | 1350 | ({ \ |
1351 | reiserfs_write_unlock(s); \ | 1351 | reiserfs_cond_resched(s); \ |
1352 | cond_resched(); \ | ||
1353 | reiserfs_write_lock(s); \ | ||
1354 | __fs_changed(gen, s); \ | 1352 | __fs_changed(gen, s); \ |
1355 | }) | 1353 | }) |
1356 | 1354 | ||