Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp311597pxj; Thu, 20 May 2021 09:51:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJN7jv7bFf1l/WX88OkUXCn1Ko6OEAGgMD7j2MU5GPQlZKvw/Mxibqu33i85RYzqGN5eES X-Received: by 2002:a05:6402:281:: with SMTP id l1mr5993026edv.58.1621529507360; Thu, 20 May 2021 09:51:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621529507; cv=none; d=google.com; s=arc-20160816; b=dNyVqL1usFDHHQessHI8c8YPzt3WD0G0ilUwWfAvrHLgPKxnZUXoax9B2udr4H2PQ6 frI2BmvZRdywkFU1WZcDy9uRAgMvYfm9pC4hXSYJ1PxPSsm/X2kkg/10HVmYjCDUgtN2 PV9bDfrVLbxDCoNDXsTLHJCt7ZTvJ/BBIyt18dLRJZHBhq0lPRZ2/vZ5yn4T+faj4CDm UIb2iGXE36L1JMzGTYE6YlvwvCjhdeoZVlCQOHtjIgmqgQYptHHj/OCSIDF5DsGNRsO3 pjeY3n1JCpGAMXjR+CjdlUSnZZFPT/FyLJiu6W0ec4UM8WMFEenQqLN41vfRRdybKg/E gpSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=mCtJeR9ckiZy6gqlz0Mo8WcysP3qF1Rw3x8FQb4wnYU=; b=xwSnrZiwWDuN2KkZWkzHBLa1cA9WIN+6XQ9rHsJ0n2+8cpzrCw/2/tSHXFtIPa7npF nph4rTf1IpvCgjRr5mWD/PRpRx7f9YFapMDtm8RjclLC5yavCaVQz8ve7ZowwZ+HzBk8 ss3pbqaUEYXVTN17edjyzvEcopVs3AjhjXQNnxQnNQ+9hK5TfEFf5VUClZ8vbqVX9s5c rhdPSLfkEUdtEuqTFxg7ZFyKbDrWlGnVXc9dhHMWl0IWHN2r+YTKmJgUYfo/+mB7Ejmk Luik8+U5MoNcGX06DU1FzsHCPUiSYE+L/j4b2Fkt5/M8n9dn8wO4tHwhrjl89lMkPj+p 6l9Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a5si2487584edy.309.2021.05.20.09.51.23; Thu, 20 May 2021 09:51:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234441AbhETJ4P (ORCPT + 99 others); Thu, 20 May 2021 05:56:15 -0400 Received: from mx2.suse.de ([195.135.220.15]:58252 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234440AbhETJwr (ORCPT ); Thu, 20 May 2021 05:52:47 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id CA114ABEA; Thu, 20 May 2021 09:51:19 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 3BD601F2C9C; Thu, 20 May 2021 11:51:19 +0200 (CEST) Date: Thu, 20 May 2021 11:51:19 +0200 From: Jan Kara To: Xing Zhengjun Cc: kernel test robot , Jan Kara , Theodore Ts'o , LKML , lkp@lists.01.org, lkp@intel.com Subject: Re: [LKP] [ext4] 05c2c00f37: aim7.jobs-per-min -11.8% regression Message-ID: <20210520095119.GA18952@quack2.suse.cz> References: <20210227120804.GB22871@xsang-OptiPlex-9020> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="gBBFr7Ir9EOA20Yy" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --gBBFr7Ir9EOA20Yy Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit Hello! On Thu 20-05-21 15:13:20, Xing Zhengjun wrote: > > ???? Do you have time to look at this? The regression still existed in the > latest Linux mainline v5.13-rc2. Thanks for verification and for the ping! I had a look into this and I think the regression is caused by the changes in orphan handling. The load runs multiple tasks all creating and deleting files. This generally contends on the orphan locking with fast storage (which is your case because you use ramdisk as a backing store AFAICT). And the changes I did move superblock checksum computation under the orphan lock so the lock hold times are now higher. Sadly it is not easy to move checksum update from under the orphan lock and maintain checksum consistency since the checksum has to be recomputed consistently with the changes of superblock state. But I have one idea how we could maybe improve the situation. Can you check whether attached patch recovers the regression? Because that's about how good it could get when we are more careful when writing out superblock. Honza -- Jan Kara SUSE Labs, CR --gBBFr7Ir9EOA20Yy Content-Type: text/x-patch; charset=us-ascii Content-Disposition: attachment; filename="0001-ext4-Experiment-with-checksum-computation-during-orp.patch" From fb788956380e066308e2a37afb97d2c4bed44de5 Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Thu, 20 May 2021 11:46:02 +0200 Subject: [PATCH] ext4: Experiment with checksum computation during orphan handling DONTMERGE. Just experiment whether this recovers performance. Signed-off-by: Jan Kara --- fs/ext4/namei.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index afb9d05a99ba..bb687ed4a604 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -3105,7 +3105,6 @@ int ext4_orphan_add(handle_t *handle, struct inode *inode) NEXT_ORPHAN(inode) = le32_to_cpu(sbi->s_es->s_last_orphan); lock_buffer(sbi->s_sbh); sbi->s_es->s_last_orphan = cpu_to_le32(inode->i_ino); - ext4_superblock_csum_set(sb); unlock_buffer(sbi->s_sbh); dirty = true; } @@ -3113,6 +3112,9 @@ int ext4_orphan_add(handle_t *handle, struct inode *inode) mutex_unlock(&sbi->s_orphan_lock); if (dirty) { + lock_buffer(sbi->s_sbh); + ext4_superblock_csum_set(sb); + unlock_buffer(sbi->s_sbh); err = ext4_handle_dirty_metadata(handle, NULL, sbi->s_sbh); rc = ext4_mark_iloc_dirty(handle, inode, &iloc); if (!err) @@ -3191,9 +3193,9 @@ int ext4_orphan_del(handle_t *handle, struct inode *inode) } lock_buffer(sbi->s_sbh); sbi->s_es->s_last_orphan = cpu_to_le32(ino_next); + mutex_unlock(&sbi->s_orphan_lock); ext4_superblock_csum_set(inode->i_sb); unlock_buffer(sbi->s_sbh); - mutex_unlock(&sbi->s_orphan_lock); err = ext4_handle_dirty_metadata(handle, NULL, sbi->s_sbh); } else { struct ext4_iloc iloc2; -- 2.26.2 --gBBFr7Ir9EOA20Yy--