From d472485f5297340831b870f30e98bac0398c2927 Mon Sep 17 00:00:00 2001 From: Artem Blagodarenko Date: Sat, 18 Feb 2017 12:00:13 +0300 Subject: [PATCH] LU-9160 ldiskfs: preload block group descriptors With 300TB OST size, we saw slow mount time, which caused 13 minutes, with this patch applied, it reduced to 30s, so this patch greatly reduce mount time, backport it from Linux upstream. Linux-commit: 85c8f176a6111ecde9c158109989dbd445a0e59a With enabled meta_bg option block group descriptors reading IO is not sequential and requires optimization. Seagate-bug-id: MRP-4129 Signed-off-by: Andrew Perepechko Signed-off-by: Artem Blagodarenko Change-Id: Iaa621c11ff88364021887d9f9dcec250dd5fd955 Signed-off-by: Wang Shilong Reviewed-on: https://review.whamcloud.com/25722 Tested-by: Jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo --- .../patches/rhel7.2/ext4-preread-gd.patch | 29 ++++++++++++++++++++++ .../series/ldiskfs-3.10-rhel7.2.series | 1 + .../series/ldiskfs-3.10-rhel7.3.series | 1 + .../series/ldiskfs-3.10-rhel7.4.series | 1 + 4 files changed, 32 insertions(+) create mode 100644 ldiskfs/kernel_patches/patches/rhel7.2/ext4-preread-gd.patch diff --git a/ldiskfs/kernel_patches/patches/rhel7.2/ext4-preread-gd.patch b/ldiskfs/kernel_patches/patches/rhel7.2/ext4-preread-gd.patch new file mode 100644 index 0000000..db3abe6 --- /dev/null +++ b/ldiskfs/kernel_patches/patches/rhel7.2/ext4-preread-gd.patch @@ -0,0 +1,29 @@ +commit 85c8f176a6111ecde9c158109989dbd445a0e59a +Author: Andrew Perepechko +AuthorDate: Sun Apr 30 00:46:35 2017 -0400 +Commit: Theodore Ts'o +CommitDate: Sun Apr 30 00:46:35 2017 -0400 +ext4: preload block group descriptors + +With enabled meta_bg option block group descriptors +reading IO is not sequential and requires optimization. + +Signed-off-by: Andrew Perepechko +Signed-off-by: Theodore Ts'o +Index: fs/ext4/super.c +=================================================================== +--- linux-stage/fs/ext4/super.c.orig ++++ linux-stage.orig/fs/ext4/super.c +@@ -3918,6 +3919,12 @@ static int ext4_fill_super(struct super_ + + bgl_lock_init(sbi->s_blockgroup_lock); + ++ /* Pre-read the descriptors into the buffer cache */ ++ for (i = 0; i < db_count; i++) { ++ block = descriptor_loc(sb, logical_sb_block, i); ++ sb_breadahead(sb, block); ++ } ++ + for (i = 0; i < db_count; i++) { + block = descriptor_loc(sb, logical_sb_block, i); + sbi->s_group_desc[i] = sb_bread(sb, block); diff --git a/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.2.series b/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.2.series index a0724e0..aa1627d 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.2.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.2.series @@ -32,3 +32,4 @@ rhel7/ext4-projid-xfs-ioctls.patch rhel7/ext4-fix-xattr-shifting-when-expanding-inodes.patch rhel7/ext4-cleanup-goto-next-group.patch rhel7/ext4-reduce-lock-contention-in-__ext4_new_inode.patch +rhel7.2/ext4-preread-gd.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.3.series b/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.3.series index fa59ce5..6f7a0db 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.3.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.3.series @@ -32,3 +32,4 @@ rhel6.3/ext4-dont-check-in-ro.patch rhel7.2/ext4-dont-check-before-replay.patch rhel7/ext4-cleanup-goto-next-group.patch rhel7/ext4-reduce-lock-contention-in-__ext4_new_inode.patch +rhel7.2/ext4-preread-gd.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.4.series b/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.4.series index f88c700..d9f7d95 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.4.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.4.series @@ -32,3 +32,4 @@ rhel6.3/ext4-dont-check-in-ro.patch rhel7.4/ext4-dont-check-before-replay.patch rhel7/ext4-cleanup-goto-next-group.patch rhel7/ext4-reduce-lock-contention-in-__ext4_new_inode.patch +rhel7.2/ext4-preread-gd.patch -- 1.8.3.1