1 Increase the buffer-head per-CPU LRU size to allow efficient
2 filesystem operations that access many blocks for each transaction.
3 For example, creating a file in a large ext4 directory with quota
4 enabled will access multiple buffer heads and will overflow the LRU
5 at the default 8-block LRU size:
7 * parent directory inode table block (ctime, nlinks for subdirs)
11 * directory leaf block (not reused, but pollutes one cache entry)
12 * 2 levels htree blocks (only one is reused, other pollutes cache)
13 * 2 levels indirect/index blocks (only one is reused)
15 The buffer-head per-CPU LRU size is raised to 16, as it shows in
16 metadata performance benchmarks up to 10% gain for create,
17 4% for lookup and 7% for destroy.
19 Signed-off-by: Liang Zhen <liang.zhen@intel.com>
20 Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
21 Signed-off-by: Sebastien Buisson <sebastien.buisson@bull.net>
24 1 files changed, 1 insertions(+), 1 deletions(-)
26 diff --git a/fs/buffer.c b/fs/buffer.c
27 index 6024877..a6468f2 100644
30 @@ -1256,7 +1256,7 @@ static struct buffer_head *__bread_slow(struct buffer_head *bh)
31 * a local interrupt disable for that.
34 -#define BH_LRU_SIZE 8
35 +#define BH_LRU_SIZE 16
38 struct buffer_head *bhs[BH_LRU_SIZE];