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 6876AC54EED for ; Tue, 24 Jan 2023 21:00:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234537AbjAXVAH (ORCPT ); Tue, 24 Jan 2023 16:00:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229747AbjAXVAE (ORCPT ); Tue, 24 Jan 2023 16:00:04 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58E3241B6B for ; Tue, 24 Jan 2023 12:59:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674593959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ITSRXrxe9LThDX6/w0/l0eds/y424Ud/UX3BCP7I4YI=; b=DXZEQJcXwxWHsfm71INuwx+7/DivOMvIpiZ58Xd0r7iCncvhvYnwlmBiiOkKT8kQ2HjaT2 9LaubgfVzDP9PNhFh520KT3Xnbo1GFbA28Tf6O7OjCo60vDK19nom8tyhCOzFBUzr2kwZg 0MdxlMX/xh+ivUy7ehYomtA9K8E+1KU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-78-W5n_P-06OaynFbzeqK7EDQ-1; Tue, 24 Jan 2023 15:59:14 -0500 X-MC-Unique: W5n_P-06OaynFbzeqK7EDQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B86EA101A521; Tue, 24 Jan 2023 20:59:13 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id 09C2E1121330; Tue, 24 Jan 2023 20:59:11 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <20230124170108.1070389-1-dhowells@redhat.com> <20230124170108.1070389-7-dhowells@redhat.com> To: Christoph Hellwig Cc: dhowells@redhat.com, Al Viro , Matthew Wilcox , Jens Axboe , Jan Kara , Jeff Layton , David Hildenbrand , Jason Gunthorpe , Logan Gunthorpe , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Christoph Hellwig Subject: Re: [PATCH v9 6/8] block: Switch to pinning pages. MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1297803.1674593951.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Tue, 24 Jan 2023 20:59:11 +0000 Message-ID: <1297804.1674593951@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Christoph Hellwig wrote: > > Add BIO_PAGE_PINNED to indicate that the pages in a bio are pinned > > (FOLL_PIN) and that the pin will need removing. > = > The subject is odd when this doesn't actually switch anything, > but just adds the infrastructure to unpin pages. How about: block: Add BIO_PAGE_PINNED and associated infrastructure > > +static inline void bio_set_cleanup_mode(struct bio *bio, struct iov_i= ter *iter) > ... > At this point I'd be tempted to just open code these two lines > instead of adding a helper, but I can live with the helper if you > prefer it. I can do that. It makes sense to put the call to that next to the call to iov_iter_extract_pages(). David