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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 55718C433E0 for ; Sun, 17 Jan 2021 21:37:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 27F2420791 for ; Sun, 17 Jan 2021 21:37:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730151AbhAQVhE (ORCPT ); Sun, 17 Jan 2021 16:37:04 -0500 Received: from mail109.syd.optusnet.com.au ([211.29.132.80]:38501 "EHLO mail109.syd.optusnet.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729744AbhAQVhA (ORCPT ); Sun, 17 Jan 2021 16:37:00 -0500 Received: from dread.disaster.area (pa49-181-54-82.pa.nsw.optusnet.com.au [49.181.54.82]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id D65ED8C0E; Mon, 18 Jan 2021 08:36:13 +1100 (AEDT) Received: from dave by dread.disaster.area with local (Exim 4.92.3) (envelope-from ) id 1l1FiX-0011je-Ct; Mon, 18 Jan 2021 08:36:13 +1100 Date: Mon, 18 Jan 2021 08:36:13 +1100 From: Dave Chinner To: Raphael Carvalho Cc: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, Avi Kivity , andres@anarazel.de Subject: Re: [RFC] xfs: reduce sub-block DIO serialisation Message-ID: <20210117213613.GC78941@dread.disaster.area> References: <20210112010746.1154363-1-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.3 cv=YKPhNiOx c=1 sm=1 tr=0 cx=a_idp_d a=NAd5MxazP4FGoF8nXO8esw==:117 a=NAd5MxazP4FGoF8nXO8esw==:17 a=kj9zAlcOel0A:10 a=EmqxpYm9HcoA:10 a=7-415B0cAAAA:8 a=0_TVRECrlnMT9PilEVQA:9 a=CjuIK1q_8ugA:10 a=biEYGPWJfzWAr4FL6Ov7:22 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org On Fri, Jan 15, 2021 at 03:45:14PM -0300, Raphael Carvalho wrote: > On Tue, Jan 12, 2021 at 7:46 AM Dave Chinner wrote: > > > Hi folks, > > > > This is the XFS implementation on the sub-block DIO optimisations > > for written extents that I've mentioned on #xfs and a couple of > > times now on the XFS mailing list. > > > > It takes the approach of using the IOMAP_NOWAIT non-blocking > > IO submission infrastructure to optimistically dispatch sub-block > > DIO without exclusive locking. If the extent mapping callback > > decides that it can't do the unaligned IO without extent > > manipulation, sub-block zeroing, blocking or splitting the IO into > > multiple parts, it aborts the IO with -EAGAIN. This allows the high > > level filesystem code to then take exclusive locks and resubmit the > > IO once it has guaranteed no other IO is in progress on the inode > > (the current implementation). > > > > I like this optimistic approach very much. One question though: If > application submits IO with RWF_NOWAIT, then this fallback step will be > avoided and application will receive EAGAIN, right? Yes, all the proposed patches do this correctly. Cheers, Dave. -- Dave Chinner david@fromorbit.com