From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 178E7C35247 for ; Mon, 3 Feb 2020 17:44:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D95BE2051A for ; Mon, 3 Feb 2020 17:44:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D95BE2051A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 824366B0665; Mon, 3 Feb 2020 12:44:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7D4E96B0667; Mon, 3 Feb 2020 12:44:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6C5596B0669; Mon, 3 Feb 2020 12:44:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0104.hostedemail.com [216.40.44.104]) by kanga.kvack.org (Postfix) with ESMTP id 508976B0665 for ; Mon, 3 Feb 2020 12:44:25 -0500 (EST) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 0BD3A181AEF15 for ; Mon, 3 Feb 2020 17:44:25 +0000 (UTC) X-FDA: 76449540090.04.cup15_7dc8b6a507c37 X-HE-Tag: cup15_7dc8b6a507c37 X-Filterd-Recvd-Size: 2119 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Mon, 3 Feb 2020 17:44:24 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id 393EE68B20; Mon, 3 Feb 2020 18:44:21 +0100 (CET) Date: Mon, 3 Feb 2020 18:44:21 +0100 From: Christoph Hellwig To: Jan Kara Cc: Christoph Hellwig , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, Waiman Long , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Will Deacon , Andrew Morton , linux-ext4@vger.kernel.org, cluster-devel@redhat.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: RFC: hold i_rwsem until aio completes Message-ID: <20200203174421.GB20001@lst.de> References: <20200114161225.309792-1-hch@lst.de> <20200116140004.GE8446@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200116140004.GE8446@quack2.suse.cz> User-Agent: Mutt/1.5.17 (2007-11-01) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Jan 16, 2020 at 03:00:04PM +0100, Jan Kara wrote: > I'd like to note that using i_dio_count has also one advantage you didn't > mention. For AIO case, if you need to hold i_rwsem in exclusive mode, > holding the i_rwsem just for submission part is a significant performance > advantage (shorter lock hold times allow for higher IO parallelism). I > guess this could be mitigated by downgrading the lock to shared mode > once the IO is submitted. But there will be still some degradation visible > for the cases of mixed exclusive and shared acquisitions because shared > holders will be blocking exclusive ones for longer time. > > This may be especially painful for filesystems that don't implement DIO > overwrites with i_rwsem in shared mode... True. Fortunately there are patches for ext4 out to move over to that scheme. gfs2 will need a little more attention, but that also for other reasons.