From: Sergey Cheremencev Date: Wed, 25 Mar 2015 12:01:21 +0000 (+0300) Subject: LU-6527 ext4: journal_commit_callback optimization X-Git-Tag: 2.7.54~27 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=512f2ff1b17db4d03979a1caa86f94defc6653b4 LU-6527 ext4: journal_commit_callback optimization Remove spin lock/unlock s_md_lock - it gives too much overhead with huge transactions. This place is not racy because txn is closed to the moment when callbacks are called. Change-Id: Ieaf76cce52854b9e5481c729bbb539eb7f97213f Signed-off-by: Sergey Cheremencev Xyratex-bug-id: MRP-2466 Reviewed-on: http://es-gerrit.xyus.xyratex.com:8080/5690 Reviewed-by: Alexey Lyashkov Reviewed-by: Alexander Zarochentsev Tested-by: Jenkins Tested-by: Elena Gryaznova Reviewed-on: http://review.whamcloud.com/14610 Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Alex Zhuravlev Reviewed-by: Oleg Drokin --- diff --git a/ldiskfs/kernel_patches/patches/rhel6.3/ext4-journal-callback.patch b/ldiskfs/kernel_patches/patches/rhel6.3/ext4-journal-callback.patch index a5df0fb..7f8a90c 100644 --- a/ldiskfs/kernel_patches/patches/rhel6.3/ext4-journal-callback.patch +++ b/ldiskfs/kernel_patches/patches/rhel6.3/ext4-journal-callback.patch @@ -447,25 +447,20 @@ Index: linux-2.6.32-504.3.3.el6.x86_64/fs/ext4/super.c =================================================================== --- linux-2.6.32-504.3.3.el6.x86_64.orig/fs/ext4/super.c +++ linux-2.6.32-504.3.3.el6.x86_64/fs/ext4/super.c -@@ -338,6 +338,23 @@ void ext4_journal_abort_handle(const cha +@@ -338,6 +338,18 @@ void ext4_journal_abort_handle(const cha EXPORT_SYMBOL(ext4_journal_abort_handle); +static void ext4_journal_commit_callback(journal_t *journal, transaction_t *txn) +{ + struct super_block *sb = journal->j_private; -+ struct ext4_sb_info *sbi = EXT4_SB(sb); + int error = is_journal_aborted(journal); + struct ext4_journal_cb_entry *jce, *tmp; + -+ spin_lock(&sbi->s_md_lock); + list_for_each_entry_safe(jce, tmp, &txn->t_private_list, jce_list) { + list_del_init(&jce->jce_list); -+ spin_unlock(&sbi->s_md_lock); + jce->jce_func(sb, jce, error); -+ spin_lock(&sbi->s_md_lock); + } -+ spin_unlock(&sbi->s_md_lock); +} + /* Deal with the reporting of failure conditions on a filesystem such as