From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757477AbdJQDIh (ORCPT ); Mon, 16 Oct 2017 23:08:37 -0400 Received: from mga04.intel.com ([192.55.52.120]:29323 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754825AbdJQDIg (ORCPT ); Mon, 16 Oct 2017 23:08:36 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,389,1503385200"; d="scan'208";a="324018955" Date: Tue, 17 Oct 2017 11:06:21 +0800 From: Ye Xiaolong To: Christoph Hellwig Cc: Al Viro , Jan Kara , LKML , Linus Torvalds , lkp@01.org Subject: Re: [lkp-robot] [fs] 91f9943e1c: aim7.jobs-per-min -26.6% regression Message-ID: <20171017030621.GR26196@yexl-desktop> References: <20171016024021.GH26196@yexl-desktop> <20171016073418.GA28778@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20171016073418.GA28778@lst.de> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/16, Christoph Hellwig wrote: >The only change for the non-nowait case is that we now do a trylock before >locking i_rwsem. In the past that was the more optimal pattern. Can you >test the patch below if that's not the case anymore? We have a few more >instances like that which might also want to be changed then. > The test result showed this fix patch helps recover the performance. Below is the comparison (41d4b81 is the fix commit applied on top of 91f9943e1c). $ compare -at 91f9943e1c7b6638f27312d03f 41d4b81c40b8873aa29b4b0224da3caf0242dd1c tests: 1 testcase/path_params/tbox_group/run: aim7/4BRD_12G-RAID1-xfs-disk_rd-9000-performance/lkp-ivb-ep01 91f9943e1c7b6638 41d4b81c40b8873aa29b4b0224 ---------------- -------------------------- %stddev change %stddev \ | \ 353690 32% 467669 aim7.jobs-per-min 153 -24% 116 aim7.time.elapsed_time 153 -24% 116 aim7.time.elapsed_time.max 5670 -26% 4184 ± 3% aim7.time.system_time 69648 ± 15% -30% 48932 ± 11% aim7.time.voluntary_context_switches 774279 ± 4% -33% 522402 ± 6% aim7.time.involuntary_context_switches 63750 -20% 51085 interrupts.CAL:Function_call_interrupts 43353 4% 45157 vmstat.system.in Thanks, Xiaolong >diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c >index 309e26c9dddb..ad61c78605d1 100644 >--- a/fs/xfs/xfs_file.c >+++ b/fs/xfs/xfs_file.c >@@ -258,10 +258,11 @@ xfs_file_buffered_aio_read( > ssize_t ret; > > trace_xfs_file_buffered_read(ip, iov_iter_count(to), iocb->ki_pos); >- >- if (!xfs_ilock_nowait(ip, XFS_IOLOCK_SHARED)) { >- if (iocb->ki_flags & IOCB_NOWAIT) >+ >+ if (iocb->ki_flags & IOCB_NOWAIT) { >+ if (!xfs_ilock_nowait(ip, XFS_IOLOCK_SHARED)) > return -EAGAIN; >+ } else { > xfs_ilock(ip, XFS_IOLOCK_SHARED); > } > ret = generic_file_read_iter(iocb, to);