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 3B8D0C54E94 for ; Tue, 24 Jan 2023 14:54:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235134AbjAXOyK (ORCPT ); Tue, 24 Jan 2023 09:54:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235126AbjAXOyH (ORCPT ); Tue, 24 Jan 2023 09:54:07 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4DD845F75; Tue, 24 Jan 2023 06:54:01 -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=GHCwlLF7wa3yuDKNbyAKB1+xPsU+XQeBpEiRl/4dAmg=; b=thE9gt5GWJRi8DSGQFxSuVj2XN wQ9x+oLubqqxo/bSLujOGaKIpLqmokTx8uhCTlBg5VLn+3zDVhw4QHINCvUmwNaKznolkrU+UeiJ5 hHv/h9KzIGll9nN2GB4YfqzgZKt8kCmG+t1M52MpIyNqVHHN1Pw2krrPFqFS3EOTTLPOfOTxJxO7+ UHZPBAxnV1s4CiLP6C9HLlorUFSgHqSelmYI5amb1J4BcnIj5M3nbQQXUQxPFq8cMft0HPtQAWb5b WmNu1LS432m7zgldrqwXmGhePg/uKXH5HCusSJ5pmjvwRgjVfKsNevkXy6f3dNw+SDjz07dL7hb/7 oRaB866g==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKKgM-004QVO-CE; Tue, 24 Jan 2023 14:53:54 +0000 Date: Tue, 24 Jan 2023 06:53:54 -0800 From: Christoph Hellwig To: David Howells Cc: David Hildenbrand , Al Viro , Christoph Hellwig , Matthew Wilcox , Jens Axboe , Jan Kara , Jeff Layton , Logan Gunthorpe , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Christoph Hellwig Subject: Re: [PATCH v8 07/10] block: Switch to pinning pages. Message-ID: References: <2431ffa0-4a37-56a2-17fa-74a5f681bcb8@redhat.com> <20230123173007.325544-1-dhowells@redhat.com> <20230123173007.325544-8-dhowells@redhat.com> <874829.1674571671@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <874829.1674571671@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-kernel@vger.kernel.org On Tue, Jan 24, 2023 at 02:47:51PM +0000, David Howells wrote: > > > +static inline void bio_set_cleanup_mode(struct bio *bio, struct iov_iter *iter) > > > +{ > > > + unsigned int cleanup_mode = iov_iter_extract_mode(iter); > > > + > > > + if (cleanup_mode & FOLL_GET) > > > + bio_set_flag(bio, BIO_PAGE_REFFED); > > > + if (cleanup_mode & FOLL_PIN) > > > + bio_set_flag(bio, BIO_PAGE_PINNED); > > > > Can FOLL_GET ever happen? > > Yes - unless patches 8 and 9 are merged. I had them as one, but Christoph > split them up. It can't. Per your latest branch: #define iov_iter_extract_mode(iter) (user_backed_iter(iter) ? FOLL_PIN : 0)