Return-Path: Received: from mx2.suse.de ([195.135.220.15]:37570 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752219AbdHPPlk (ORCPT ); Wed, 16 Aug 2017 11:41:40 -0400 From: Jan Kara To: Cc: Wang Shilong , Jan Kara Subject: [PATCH 22/27] ext4: Disable dirty list tracking of dquots when journalling quotas Date: Wed, 16 Aug 2017 17:41:22 +0200 Message-Id: <20170816154127.7048-23-jack@suse.cz> In-Reply-To: <20170816154127.7048-1-jack@suse.cz> References: <20170816154127.7048-1-jack@suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: When journalling quotas, we writeback all dquots immediately after changing them as part of current transation. Thus there's no need to write anything in dquot_writeback_dquots() and so we can avoid updating list of dirty dquots to reduce dq_list_lock contention. This change reduces time to create 500000 files on ext4 on ramdisk by 50 different processes in separate directories by 15% when user quota is turned on. Signed-off-by: Jan Kara --- fs/ext4/super.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 8e0c27387ab7..eac9f8c50631 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -5409,6 +5409,13 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id, ext4_msg(sb, KERN_WARNING, "Quota file not on filesystem root. " "Journaled quota will not work"); + sb_dqopt(sb)->flags |= DQUOT_NOLIST_DIRTY; + } else { + /* + * Clear the flag just in case mount options changed since + * last time. + */ + sb_dqopt(sb)->flags &= ~DQUOT_NOLIST_DIRTY; } /* @@ -5505,7 +5512,7 @@ static int ext4_enable_quotas(struct super_block *sb) test_opt(sb, PRJQUOTA), }; - sb_dqopt(sb)->flags |= DQUOT_QUOTA_SYS_FILE; + sb_dqopt(sb)->flags |= DQUOT_QUOTA_SYS_FILE | DQUOT_NOLIST_DIRTY; for (type = 0; type < EXT4_MAXQUOTAS; type++) { if (qf_inums[type]) { err = ext4_quota_enable(sb, type, QFMT_VFS_V1, -- 2.12.3