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:
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 Signed-off-by: Liang Zhen <liang@whamcoud.com>
16 Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
18 --- linux-2.6.32-131.6.1/fs/buffer.c
19 +++ linux-2.6.32-131.6.1-pdo/fs/buffer.c
21 * The LRUs themselves only need locking against invalidate_bh_lrus. We use
22 * a local interrupt disable for that.
25 -#define BH_LRU_SIZE 8
26 +#define BH_LRU_SIZE CONFIG_BH_LRU_SIZE
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
33 source "fs/nls/Kconfig"
34 source "fs/dlm/Kconfig"
37 + int "buffer head per-CPU LRU size"
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.