Whamcloud - gitweb
LU-5729 osd: iput in case of error in osd_scrub_setup
[fs/lustre-release.git] / lustre / kernel_patches / patches / bh_lru_size_config.patch
1 Allow increasing 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 accesses 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 Signed-off-by: Liang Zhen <liang@whamcoud.com>
16 Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
17
18 --- linux-2.6.32-131.6.1/fs/buffer.c
19 +++ linux-2.6.32-131.6.1-pdo/fs/buffer.c
20 @@ -1250,8 +1250,7 @@
21   * The LRUs themselves only need locking against invalidate_bh_lrus.  We use
22   * a local interrupt disable for that.
23   */
24 -
25 -#define BH_LRU_SIZE    8
26 +#define BH_LRU_SIZE    CONFIG_BH_LRU_SIZE
27  
28  struct bh_lru {
29         struct buffer_head *bhs[BH_LRU_SIZE];
30 --- linux-2.6.32-131.6.1/fs/Kconfig
31 +++ linux-2.6.32-131.6.1-pdo/fs/Kconfig
32 @@ -253,4 +253,13 @@
33  source "fs/nls/Kconfig"
34  source "fs/dlm/Kconfig"
35  
36 +config BH_LRU_SIZE
37 +      int "buffer head per-CPU LRU size"
38 +      range 8 64
39 +      default "16"
40 +      help
41 +        This sets the per-CPU LRU size for buffer heads in memory.
42 +        More complex filesystems may be modiyfing multiple blocks
43 +        within a single transaction, so keeping the buffer heads in
44 +        CPU-local cache speeds up modifations significantly.
45  endmenu