Whamcloud - gitweb
LU-6527 ext4: journal_commit_callback optimization 10/14610/2
authorSergey Cheremencev <sergey.cheremencev@seagate.com>
Wed, 25 Mar 2015 12:01:21 +0000 (15:01 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 7 May 2015 16:18:27 +0000 (16:18 +0000)
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 <sergey.cheremencev@seagate.com>
Xyratex-bug-id: MRP-2466
Reviewed-on: http://es-gerrit.xyus.xyratex.com:8080/5690
Reviewed-by: Alexey Lyashkov <alexey.lyashkov@seagate.com>
Reviewed-by: Alexander Zarochentsev <alexander.zarochentsev@seagate.com>
Tested-by: Jenkins
Tested-by: Elena Gryaznova <elena.gryaznova@seagate.com>
Reviewed-on: http://review.whamcloud.com/14610
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
ldiskfs/kernel_patches/patches/rhel6.3/ext4-journal-callback.patch

index a5df0fb..7f8a90c 100644 (file)
@@ -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