From 16ce6a7ecb1558c5a18e8ba4751fef71e6bb97bc Mon Sep 17 00:00:00 2001 From: Yang Sheng Date: Wed, 9 Mar 2016 23:01:14 +0800 Subject: [PATCH] LU-6527 ldiskfs: Journal commit callback optimization Porting patch for RHEL7, SLES11 & SLES12 This is a porting patch from: Lustre-change: http://review.whamcloud.com/14611/ Lustre-commit: 55afbf5934e145e48a31193de601abd58e605a42 Don't take spinlock in tgt_cb_last_committed, if exp_last_committed was updated with higher trasno. Also change list_add_tail to list_add. It gives advantages to ldiskfs in tgt_cb_last_committed. In the beginning of list will be placed thandles with the highest transaction numbers. So at the first iterations we will have the highest transno. It will save from extra call of ptlrpc_commit_replies. Signed-off-by: Sergey Cheremencev Xyratex-bug-id: MRP-2575 Reviewed-by: Alexander Zarochentsev Reviewed-by: Alexander Boyko Tested-by: Alexander Lezhoev Reviewed-by: Alexey Leonidovich Lyashkov Reviewed-by: Alex Zhuravlev Reviewed-by: Mike Pershin Reviewed-by: Oleg Drokin Signed-off-by: Yang Sheng Change-Id: I3e7f28e5386cf77f3139ff0d330afadf8864c293 Reviewed-on: http://review.whamcloud.com/18835 Reviewed-by: Bob Glossman Tested-by: Jenkins Tested-by: Maloo --- .../patches/rhel7/ext4-jcb-optimization.patch | 19 +++++++++++++++++++ .../patches/sles11sp2/ext4-journal-callback.patch | 2 +- .../kernel_patches/series/ldiskfs-3.10-rhel7.2.series | 1 + .../kernel_patches/series/ldiskfs-3.10-rhel7.series | 1 + .../kernel_patches/series/ldiskfs-3.12-sles12.series | 1 + .../series/ldiskfs-3.12-sles12sp1.series | 1 + 6 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 ldiskfs/kernel_patches/patches/rhel7/ext4-jcb-optimization.patch diff --git a/ldiskfs/kernel_patches/patches/rhel7/ext4-jcb-optimization.patch b/ldiskfs/kernel_patches/patches/rhel7/ext4-jcb-optimization.patch new file mode 100644 index 0000000..2d25d14 --- /dev/null +++ b/ldiskfs/kernel_patches/patches/rhel7/ext4-jcb-optimization.patch @@ -0,0 +1,19 @@ +Change list_add_tail to list_add. It gives advantages to ldiskfs +in tgt_cb_last_committed. In the beginning of list will be placed +thandles with the highest transaction numbers. So at the first +iterations we will have the highest transno. It will save from +extra call of ptlrpc_commit_replies. + +Index: linux-3.10.0-229.1.2.fc21.x86_64/fs/ext4/ext4_jbd2.c +=================================================================== +--- linux-3.10.0-229.1.2.fc21.x86_64.orig/fs/ext4/ext4_jbd2.h ++++ linux-3.10.0-229.1.2.fc21.x86_64/fs/ext4/ext4_jbd2.h +@@ -3644,7 +3644,7 @@ void ext4_truncate(struct inode *inode) + /* Add the jce to transaction's private list */ + jce->jce_func = func; + spin_lock(&sbi->s_md_lock); +- list_add_tail(&jce->jce_list, &handle->h_transaction->t_private_list); ++ list_add(&jce->jce_list, &handle->h_transaction->t_private_list); + spin_unlock(&sbi->s_md_lock); + } + diff --git a/ldiskfs/kernel_patches/patches/sles11sp2/ext4-journal-callback.patch b/ldiskfs/kernel_patches/patches/sles11sp2/ext4-journal-callback.patch index f55e6ce..6294be9 100644 --- a/ldiskfs/kernel_patches/patches/sles11sp2/ext4-journal-callback.patch +++ b/ldiskfs/kernel_patches/patches/sles11sp2/ext4-journal-callback.patch @@ -79,7 +79,7 @@ Acked-by: Jeff Mahoney + /* Add the jce to transaction's private list */ + jce->jce_func = func; + spin_lock(&sbi->s_md_lock); -+ list_add_tail(&jce->jce_list, &handle->h_transaction->t_private_list); ++ list_add(&jce->jce_list, &handle->h_transaction->t_private_list); + spin_unlock(&sbi->s_md_lock); +} + 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 39046a6..db32551 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.2.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.2.series @@ -19,3 +19,4 @@ rhel7/ext4-remove-truncate-warning.patch rhel7/ext4-corrupted-inode-block-bitmaps-handling-patches.patch rhel7/ext4-give-warning-with-dir-htree-growing.patch rhel7/ext4-mmp-brelse.patch +rhel7/ext4-jcb-optimization.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.series b/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.series index cee174a..69906c5 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.series @@ -19,3 +19,4 @@ rhel7/ext4-remove-truncate-warning.patch rhel7/ext4-corrupted-inode-block-bitmaps-handling-patches.patch rhel7/ext4-give-warning-with-dir-htree-growing.patch rhel7/ext4-mmp-brelse.patch +rhel7/ext4-jcb-optimization.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-3.12-sles12.series b/ldiskfs/kernel_patches/series/ldiskfs-3.12-sles12.series index 570d558..286fbf1 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-3.12-sles12.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-3.12-sles12.series @@ -19,3 +19,4 @@ sles12/ext4-remove-truncate-warning.patch sles12/ext4-corrupted-inode-block-bitmaps-handling-patches.patch rhel7/ext4-give-warning-with-dir-htree-growing.patch rhel7/ext4-mmp-brelse.patch +rhel7/ext4-jcb-optimization.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-3.12-sles12sp1.series b/ldiskfs/kernel_patches/series/ldiskfs-3.12-sles12sp1.series index e114f92..9ba99ec 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-3.12-sles12sp1.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-3.12-sles12sp1.series @@ -19,3 +19,4 @@ sles12/ext4-remove-truncate-warning.patch sles12/ext4-corrupted-inode-block-bitmaps-handling-patches.patch rhel7/ext4-give-warning-with-dir-htree-growing.patch rhel7/ext4-mmp-brelse.patch +rhel7/ext4-jcb-optimization.patch -- 1.8.3.1