Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5269684ybp; Mon, 7 Oct 2019 23:35:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqxr18WcFAEyn6+s35/BPYeENRYiX3vdvE2VxPcxUXz2gP51wqm7CfnoMuvEVNzStRf0RNuJ X-Received: by 2002:a05:6402:1246:: with SMTP id l6mr31906358edw.213.1570516540940; Mon, 07 Oct 2019 23:35:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570516540; cv=none; d=google.com; s=arc-20160816; b=Q8FN9mZ+SEqVNJwIpHCthdMjAhaJhR8gQ3yeZ3vpNUaE+vWWtwthxXtbUJrvi0x9et L4svfqBKz4nQ1Y6Q3qhBkrg4Eu03hp1M3tzuVKWXgJ4ior9ARntsKpctIsYg7Ghj98Q5 sQbQGGP6kwa8CY+Ld/l4b64Rl8aVl8MVVGi0UuZe/E2Y2on+100a79MmBaW7CEQTe2Yt pSmuMS61KinSbvHna/aXAXblv+i7LrTyIuzCW2K9ZsoR3K7y0p/H7RWgZbHmSuC/XARc rrepW/M3iAtlPbJ2O+Ewm9tQF1VQvTxQ/SkNiPp+f9/AcNoR1G2yZZYo/6hYu8GH/+26 zEJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=hb1S03MymH3fI8iSYA4q3vMlvcAVMrlHhWWMrAT/p7s=; b=LPFvzEREGCXUWxYNEa5McWAtPoLKBhJXYieWsSnRcI42dTxxco0HrM7j5v67vGEcOe LHeXuU5eszQoUHaGHxpW64YUtBFMa9Hp2KDKaEUwp5SbkK4KN7B5vuL1v3PsbZ0z9Fq2 Hb7GRYwUBgwb865CwiWSc90EFhRPmiVp6n4Ye0lPNffJK4867/Gge0iUttXJfyTle1Vb OlGe/PdjdCOklJZIRFYomb/FZ9pQEuNc6mZaGfsTchFjLPgf+ANu3X2UUiREIW8AlroP 5SjBl69cJG0akafyO7kgV5yKF3HUHVG9h/tKMTdDT+TZu25aZfvgF61mseA3tTtqEkSJ yJoQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u3si9060606edy.48.2019.10.07.23.35.17; Mon, 07 Oct 2019 23:35:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730090AbfJHGek (ORCPT + 99 others); Tue, 8 Oct 2019 02:34:40 -0400 Received: from verein.lst.de ([213.95.11.211]:44049 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729740AbfJHGek (ORCPT ); Tue, 8 Oct 2019 02:34:40 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id B73F668B20; Tue, 8 Oct 2019 08:34:36 +0200 (CEST) Date: Tue, 8 Oct 2019 08:34:36 +0200 From: Christoph Hellwig To: Dave Chinner Cc: Christoph Hellwig , "Darrick J . Wong" , Damien Le Moal , Andreas Gruenbacher , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 02/11] iomap: copy the xfs writeback code to iomap.c Message-ID: <20191008063436.GA30465@lst.de> References: <20191006154608.24738-1-hch@lst.de> <20191006154608.24738-3-hch@lst.de> <20191007214353.GZ16973@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191007214353.GZ16973@dread.disaster.area> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 08, 2019 at 08:43:53AM +1100, Dave Chinner wrote: > > +static int > > +iomap_ioend_compare(void *priv, struct list_head *a, struct list_head *b) > > +{ > > + struct iomap_ioend *ia, *ib; > > + > > + ia = container_of(a, struct iomap_ioend, io_list); > > + ib = container_of(b, struct iomap_ioend, io_list); > > + if (ia->io_offset < ib->io_offset) > > + return -1; > > + else if (ia->io_offset > ib->io_offset) > > + return 1; > > + return 0; > > No need for the else here. That is usually my comment :) But in this case it is just copied over code, so I didn't want to do cosmetic changes. > > + /* > > + * Given that we do not allow direct reclaim to call us, we should > > + * never be called while in a filesystem transaction. > > + */ > > + if (WARN_ON_ONCE(current->flags & PF_MEMALLOC_NOFS)) > > + goto redirty; > > Is this true for all expected callers of these functions rather than > just XFS? i.e. PF_MEMALLOC_NOFS is used by transactions in XFS to > prevent transaction context recursion, but other filesystems do not > do this.. > > FWIW, I can also see that this is going to cause us problems if high > level code starts using memalloc_nofs_save() and then calling > filemap_datawrite() and friends... We have the check for direct reclaim just above, so any file system using this iomap code will not allow direct reclaim. Which I think is a very good idea given that direct reclaim through the file system is a very bad idea. That leaves with only the filemap_datawrite case, which so far is theoretical. If that ever becomes a think it is very obvious and we can just remove the debug check. > > +iomap_writepage(struct page *page, struct writeback_control *wbc, > > + struct iomap_writepage_ctx *wpc, > > + const struct iomap_writeback_ops *ops) > > +{ > > + int ret; > > + > > + wpc->ops = ops; > > + ret = iomap_do_writepage(page, wbc, wpc); > > + if (!wpc->ioend) > > + return ret; > > + return iomap_submit_ioend(wpc, wpc->ioend, ret); > > +} > > +EXPORT_SYMBOL_GPL(iomap_writepage); > > Can we kill ->writepage for iomap users, please? After all, we don't > mostly don't allow memory reclaim to do writeback of dirty pages, > and that's the only caller of ->writepage. I'd rather not do this as part of this move. But if you could expedite your patch to kill ->writepage from the large block size support patch and submit it ASAP on top of this series I would be very much in favor.