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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2202DC63797 for ; Tue, 17 Jan 2023 08:45:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236171AbjAQIpE (ORCPT ); Tue, 17 Jan 2023 03:45:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236177AbjAQIov (ORCPT ); Tue, 17 Jan 2023 03:44:51 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C63312CFD0; Tue, 17 Jan 2023 00:44:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=B78y0VpcNvaNsUxIiihgFPrvqCbss5Z11dzMWjX4LvA=; b=rfYsJlEozbyBZuSblQN507XRqm DRWDdxv5x1kqdV9WC8xnqWa2pPT/7YeYN8mVG36tuua/QNFFtl9BpY4DjQP7D+nwWrEslHS7ETTO9 Gr59jLK5bp6lLBdHPQozGA62c/yyLthADMEA4ep9cbFmWL29oBouWOUAk2oCJb2VmLTNj1ZmMkJel OSlCSnLfEiD2NxmvVhhyoFzk2INF1yZmg14JZFxRQl0pz3iXLffiI06e49ekYEBvvyJof2kcZtRB1 mlY8Jn5kHSRovvNc7qrkhZUU30SSeVoVOyrU3GjFhMYtu5t3ybcenG6rimkGDNkeyWeWEVFAkOxdU ICLfiW9w==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHhaE-00DMe7-M0; Tue, 17 Jan 2023 08:44:42 +0000 Date: Tue, 17 Jan 2023 00:44:42 -0800 From: Christoph Hellwig To: David Howells Cc: Christoph Hellwig , Al Viro , Jens Axboe , Jan Kara , Christoph Hellwig , Matthew Wilcox , Logan Gunthorpe , linux-block@vger.kernel.org, Jeff Layton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 11/34] iov_iter, block: Make bio structs pin pages rather than ref'ing if appropriate Message-ID: References: <167391047703.2311931.8115712773222260073.stgit@warthog.procyon.org.uk> <167391056047.2311931.6772604381276147664.stgit@warthog.procyon.org.uk> <2330754.1673943968@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2330754.1673943968@warthog.procyon.org.uk> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Tue, Jan 17, 2023 at 08:26:08AM +0000, David Howells wrote: > Um... With these patches, BIO_PAGE_REFFED is set by default when the bio is > initialised otherwise every user of struct bio that currently adds pages > directly (assuming there are any) rather than going through > bio_iov_iter_get_pages() will have to set the flag, hence the need to clear > it. I think we need to fix that (in the patch inverting the polarity) and only set the flag where it is needed. All eventually calls come from the direct I/O code in the block layer, iomap, legacy generic and zonefs, and they release pages that came from some form of hup. So we can just set BIO_PAGE_REFFED in bio_iov_iter_get_pages and dio_refill_pages.