From 539d4de9218a16c0c3d110d4f873f67864cb4f8f Mon Sep 17 00:00:00 2001 From: Sebastien Buisson Date: Wed, 5 Nov 2014 16:34:14 +0100 Subject: [PATCH] LU-20 kernel: increase BH_LRU_SIZE to 16 As kernel community did not want a complicated way of modifying BH_LRU_SIZE, it was proposed to directly set it to 16. This has been accepted. This patch is merged in the upstream kernel: http://git.kernel.org/cgit/linux/kernel/git/torvalds/ linux.git/commit/?id=86cf78d73de8c6bfa89804b91ee0ace71a459961 Signed-off-by: Sebastien Buisson Change-Id: I71fb455de9ec70ed90f86d402ae76ecfba1e1e61 Reviewed-on: http://review.whamcloud.com/12577 Tested-by: Jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: James Simmons --- .../patches/bh_lru_size_config.patch | 45 ---------------------- .../patches/bh_lru_size_increase.patch | 41 ++++++++++++++++++++ lustre/kernel_patches/series/2.6-rhel6.series | 2 +- lustre/kernel_patches/series/2.6-sles11.series | 2 +- lustre/kernel_patches/series/3.0-sles11.series | 2 +- lustre/kernel_patches/series/3.0-sles11sp3.series | 2 +- lustre/kernel_patches/series/3.10-rhel7.series | 2 +- lustre/kernel_patches/series/3.x-fc18.series | 2 +- 8 files changed, 47 insertions(+), 51 deletions(-) delete mode 100644 lustre/kernel_patches/patches/bh_lru_size_config.patch create mode 100644 lustre/kernel_patches/patches/bh_lru_size_increase.patch diff --git a/lustre/kernel_patches/patches/bh_lru_size_config.patch b/lustre/kernel_patches/patches/bh_lru_size_config.patch deleted file mode 100644 index 4db0102..0000000 --- a/lustre/kernel_patches/patches/bh_lru_size_config.patch +++ /dev/null @@ -1,45 +0,0 @@ -Allow increasing the buffer-head per-CPU LRU size to allow efficient -filesystem operations that access many blocks for each transaction. -For example, creating a file in a large ext4 directory with quota -enabled will accesses multiple buffer heads and will overflow the LRU -at the default 8-block LRU size: - -* parent directory inode table block (ctime, nlinks for subdirs) -* new inode bitmap -* inode table block -* 2 quota blocks -* directory leaf block (not reused, but pollutes one cache entry) -* 2 levels htree blocks (only one is reused, other pollutes cache) -* 2 levels indirect/index blocks (only one is reused) - -Signed-off-by: Liang Zhen -Signed-off-by: Andreas Dilger - ---- linux-2.6.32-131.6.1/fs/buffer.c -+++ linux-2.6.32-131.6.1-pdo/fs/buffer.c -@@ -1250,8 +1250,7 @@ - * The LRUs themselves only need locking against invalidate_bh_lrus. We use - * a local interrupt disable for that. - */ -- --#define BH_LRU_SIZE 8 -+#define BH_LRU_SIZE CONFIG_BH_LRU_SIZE - - struct bh_lru { - struct buffer_head *bhs[BH_LRU_SIZE]; ---- linux-2.6.32-131.6.1/fs/Kconfig -+++ linux-2.6.32-131.6.1-pdo/fs/Kconfig -@@ -253,4 +253,13 @@ - source "fs/nls/Kconfig" - source "fs/dlm/Kconfig" - -+config BH_LRU_SIZE -+ int "buffer head per-CPU LRU size" -+ range 8 64 -+ default "16" -+ help -+ This sets the per-CPU LRU size for buffer heads in memory. -+ More complex filesystems may be modiyfing multiple blocks -+ within a single transaction, so keeping the buffer heads in -+ CPU-local cache speeds up modifations significantly. - endmenu diff --git a/lustre/kernel_patches/patches/bh_lru_size_increase.patch b/lustre/kernel_patches/patches/bh_lru_size_increase.patch new file mode 100644 index 0000000..6cd1a8d --- /dev/null +++ b/lustre/kernel_patches/patches/bh_lru_size_increase.patch @@ -0,0 +1,41 @@ +Increase the buffer-head per-CPU LRU size to allow efficient +filesystem operations that access many blocks for each transaction. +For example, creating a file in a large ext4 directory with quota +enabled will access multiple buffer heads and will overflow the LRU +at the default 8-block LRU size: + +* parent directory inode table block (ctime, nlinks for subdirs) +* new inode bitmap +* inode table block +* 2 quota blocks +* directory leaf block (not reused, but pollutes one cache entry) +* 2 levels htree blocks (only one is reused, other pollutes cache) +* 2 levels indirect/index blocks (only one is reused) + +The buffer-head per-CPU LRU size is raised to 16, as it shows in +metadata performance benchmarks up to 10% gain for create, +4% for lookup and 7% for destroy. + +Signed-off-by: Liang Zhen +Signed-off-by: Andreas Dilger +Signed-off-by: Sebastien Buisson +--- + fs/buffer.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/fs/buffer.c b/fs/buffer.c +index 6024877..a6468f2 100644 +--- a/fs/buffer.c ++++ b/fs/buffer.c +@@ -1256,7 +1256,7 @@ static struct buffer_head *__bread_slow(struct buffer_head *bh) + * a local interrupt disable for that. + */ + +-#define BH_LRU_SIZE 8 ++#define BH_LRU_SIZE 16 + + struct bh_lru { + struct buffer_head *bhs[BH_LRU_SIZE]; +-- +1.7.1 + diff --git a/lustre/kernel_patches/series/2.6-rhel6.series b/lustre/kernel_patches/series/2.6-rhel6.series index 0e2d05a..0fab6ac 100644 --- a/lustre/kernel_patches/series/2.6-rhel6.series +++ b/lustre/kernel_patches/series/2.6-rhel6.series @@ -2,7 +2,7 @@ mpt-fusion-max-sge-rhel6.patch raid5-mmp-unplug-dev-rhel6.patch dev_read_only-2.6.32-rhel6.patch blkdev_tunables-2.6-rhel6.patch -bh_lru_size_config.patch +bh_lru_size_increase.patch quota-replace-dqptr-sem.patch quota-avoid-dqget-calls.patch jbd2-log_wait_for_space-2.6-rhel6.patch diff --git a/lustre/kernel_patches/series/2.6-sles11.series b/lustre/kernel_patches/series/2.6-sles11.series index a5134293..ef74284 100644 --- a/lustre/kernel_patches/series/2.6-sles11.series +++ b/lustre/kernel_patches/series/2.6-sles11.series @@ -1,5 +1,5 @@ raid5-mmp-unplug-dev-sles11sp1.patch dev_read_only-2.6.32-sles11.patch -bh_lru_size_config.patch +bh_lru_size_increase.patch quota-replace-dqptr-sem-sles11.patch quota-avoid-dqget-calls.patch diff --git a/lustre/kernel_patches/series/3.0-sles11.series b/lustre/kernel_patches/series/3.0-sles11.series index 18549a9..b91fa51 100644 --- a/lustre/kernel_patches/series/3.0-sles11.series +++ b/lustre/kernel_patches/series/3.0-sles11.series @@ -2,5 +2,5 @@ raid5-mmp-unplug-dev-sles11sp2.patch quota-replace-dqptr-sem-sles11sp2.patch quota-avoid-dqget-calls-sles11sp2.patch blkdev_tunables-3.0-sles11.patch -bh_lru_size_config.patch +bh_lru_size_increase.patch jbd2-log_wait_for_space-2.6-rhel6.patch diff --git a/lustre/kernel_patches/series/3.0-sles11sp3.series b/lustre/kernel_patches/series/3.0-sles11sp3.series index c40c5f1..fc4e4cc 100644 --- a/lustre/kernel_patches/series/3.0-sles11sp3.series +++ b/lustre/kernel_patches/series/3.0-sles11sp3.series @@ -2,5 +2,5 @@ raid5-mmp-unplug-dev-sles11sp2.patch quota-replace-dqptr-sem-sles11sp2.patch quota-avoid-dqget-calls-sles11sp2.patch blkdev_tunables-3.0-sles11sp3.patch -bh_lru_size_config.patch +bh_lru_size_increase.patch jbd2-log_wait_for_space-2.6-rhel6.patch diff --git a/lustre/kernel_patches/series/3.10-rhel7.series b/lustre/kernel_patches/series/3.10-rhel7.series index 387a2dd..b19b544 100644 --- a/lustre/kernel_patches/series/3.10-rhel7.series +++ b/lustre/kernel_patches/series/3.10-rhel7.series @@ -1,4 +1,4 @@ raid5-mmp-unplug-dev-3.7.patch dev_read_only-3.7.patch blkdev_tunables-3.7.patch -bh_lru_size_config.patch +bh_lru_size_increase.patch diff --git a/lustre/kernel_patches/series/3.x-fc18.series b/lustre/kernel_patches/series/3.x-fc18.series index 387a2dd..b19b544 100644 --- a/lustre/kernel_patches/series/3.x-fc18.series +++ b/lustre/kernel_patches/series/3.x-fc18.series @@ -1,4 +1,4 @@ raid5-mmp-unplug-dev-3.7.patch dev_read_only-3.7.patch blkdev_tunables-3.7.patch -bh_lru_size_config.patch +bh_lru_size_increase.patch -- 1.8.3.1