Whamcloud - gitweb
LU-20 kernel: increase BH_LRU_SIZE to 16 77/12577/2
authorSebastien Buisson <sebastien.buisson@bull.net>
Wed, 5 Nov 2014 15:34:14 +0000 (16:34 +0100)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 19 Nov 2014 19:17:56 +0000 (19:17 +0000)
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 <sebastien.buisson@bull.net>
Change-Id: I71fb455de9ec70ed90f86d402ae76ecfba1e1e61
Reviewed-on: http://review.whamcloud.com/12577
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
lustre/kernel_patches/patches/bh_lru_size_config.patch [deleted file]
lustre/kernel_patches/patches/bh_lru_size_increase.patch [new file with mode: 0644]
lustre/kernel_patches/series/2.6-rhel6.series
lustre/kernel_patches/series/2.6-sles11.series
lustre/kernel_patches/series/3.0-sles11.series
lustre/kernel_patches/series/3.0-sles11sp3.series
lustre/kernel_patches/series/3.10-rhel7.series
lustre/kernel_patches/series/3.x-fc18.series

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 (file)
index 4db0102..0000000
+++ /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 <liang@whamcoud.com>
-Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
-
---- 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 (file)
index 0000000..6cd1a8d
--- /dev/null
@@ -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 <liang.zhen@intel.com>
+Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
+Signed-off-by: Sebastien Buisson <sebastien.buisson@bull.net>
+---
+ 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
+
index 0e2d05a..0fab6ac 100644 (file)
@@ -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
index a513429..ef74284 100644 (file)
@@ -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
index 18549a9..b91fa51 100644 (file)
@@ -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
index c40c5f1..fc4e4cc 100644 (file)
@@ -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
index 387a2dd..b19b544 100644 (file)
@@ -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
index 387a2dd..b19b544 100644 (file)
@@ -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