Whamcloud - gitweb
LU-20 kernel: increase BH_LRU_SIZE to 16
[fs/lustre-release.git] / lustre / kernel_patches / patches / bh_lru_size_increase.patch
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:
6
7 * parent directory inode table block (ctime, nlinks for subdirs)
8 * new inode bitmap
9 * inode table block
10 * 2 quota blocks
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)
14
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.
18
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>
22 ---
23  fs/buffer.c |    2 +-
24  1 files changed, 1 insertions(+), 1 deletions(-)
25
26 diff --git a/fs/buffer.c b/fs/buffer.c
27 index 6024877..a6468f2 100644
28 --- a/fs/buffer.c
29 +++ b/fs/buffer.c
30 @@ -1256,7 +1256,7 @@ static struct buffer_head *__bread_slow(struct buffer_head *bh)
31   * a local interrupt disable for that.
32   */
33  
34 -#define BH_LRU_SIZE    8
35 +#define BH_LRU_SIZE    16
36  
37  struct bh_lru {
38         struct buffer_head *bhs[BH_LRU_SIZE];
39 -- 
40 1.7.1
41