Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp3973262rwb; Mon, 5 Sep 2022 23:52:20 -0700 (PDT) X-Google-Smtp-Source: AA6agR7QAFebW3CdkIKeCOJAOjqCGooDQUQIosRpD+ztqERWoKvkVYwJk8wtulcfQImfkuOMudd1 X-Received: by 2002:a17:90b:35c3:b0:1fe:10c4:cfb7 with SMTP id nb3-20020a17090b35c300b001fe10c4cfb7mr23063217pjb.60.1662447140648; Mon, 05 Sep 2022 23:52:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662447140; cv=none; d=google.com; s=arc-20160816; b=aP5UYZVDrK4Hc4tESIvjj4pPH0hKWl5Jkx3eiv7+En8tpXvx9BjQ2d5Yx40CmEitCj xli+aplvbhmnsHoIQ+agvDmuBMync5r/QGbNd9OoR8uMXqC9QejmEISU93LKEvinQ7Yw 8pzbCTsIK631n4/E29VyvXR+NBJ2bSLuw9tE1ROHnIcyteL4FwkebpgPj0+Xb2HaGZSg T9XhbhjF7rPEC8PK9UmUwKqFThlFVl23Kv9pbu0i5w9/GuN7V3+3yG+7w1tQTXl/LFMR CbI+AWCtJXuEczLThGQ2WNj9Se0UI4bPwVpS7rwgLR+vU4WeHot/Op6I8MmBnCrbJNNg s65g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=oFuTZk4zKE5mAVI0W5HcV1QEwth0M1OUe/8JfOFc7i4=; b=vwI7f3QgU99bmkZvgJt+5BvxafWd2V9h64fh9NCDn896jdjtnXYzVVl/pfNCGYCBJK GJpFSHm0EdnbMHeQ40zZhYGflkCt5TDa+CDD7XvEyi/gzNX4gcZlns6APy+oLYhxE+82 UpHBqIDiBKQPfnFYTLso/h355FBiBZzyVNS0bWMmS7Ccd+CavpGhlp8kogJJ9NI5wvt+ TPjMgm+F63PErABTw3+KbpYg7lhyGA9X+1NTQ2idpszpc8ud9vhmowdv1WuRo1cIdlJp uQXZz220mkwWqNQWrtTIWFTpSQ2w5y/C2Ab7+HSlOw/WXzz/+Ki9KSWn7Gmj4ZNHRkgD ooWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=qu2isCif; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gf12-20020a17090ac7cc00b001fe266f17ccsi5381436pjb.127.2022.09.05.23.51.57; Mon, 05 Sep 2022 23:52:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=qu2isCif; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238538AbiIFGsD (ORCPT + 99 others); Tue, 6 Sep 2022 02:48:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238495AbiIFGsC (ORCPT ); Tue, 6 Sep 2022 02:48:02 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B65846FA2A; Mon, 5 Sep 2022 23:48:01 -0700 (PDT) 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=oFuTZk4zKE5mAVI0W5HcV1QEwth0M1OUe/8JfOFc7i4=; b=qu2isCifsZ2DAo2Q5ZJ8unnHj8 lYJqoyJRc11lTwpPaUNVLA+1+Y87Tvpx76OepMVZu+0gIu/+vIuNEeff37Z4KS8KT//T7tAbGaLko XyDJaWYJhzxKG8CK4N4THMRd/2w88PEn3nJp0mia12EUesXoFRN4lHfipW1PMHBt6cJA88nJzgmQv XpF7iA46K9x9Mp0blxVRAOYNNICAbtjNtF+rYr+zfhmIpxZDK4CKNHRp6VKJpXp5gwGZFE0pc2KY9 WGnsJmMDwaaAi+FpCAyEsH5JCqI8U2PJBGjMc4jwhsPw+cHPHYzJolat+Lpf3slGwBhEmDxRmrJ58 M9K8XWLQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVSND-00AXVf-Qh; Tue, 06 Sep 2022 06:47:51 +0000 Date: Mon, 5 Sep 2022 23:47:51 -0700 From: Christoph Hellwig To: John Hubbard Cc: Andrew Morton , Jens Axboe , Alexander Viro , Miklos Szeredi , Christoph Hellwig , "Darrick J . Wong" , Trond Myklebust , Anna Schumaker , Jan Kara , David Hildenbrand , Logan Gunthorpe , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-nfs@vger.kernel.org, linux-mm@kvack.org, LKML Subject: Re: [PATCH v2 4/7] iov_iter: new iov_iter_pin_pages*() routines Message-ID: References: <20220831041843.973026-1-jhubbard@nvidia.com> <20220831041843.973026-5-jhubbard@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220831041843.973026-5-jhubbard@nvidia.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org I'd it one step back. For BVECS we never need a get or pin. The block layer already does this, an the other callers should as well. For KVEC the same is true. For PIPE and xarray as you pointed out we can probably just do the pin, it is not like these are performance paths. So, I'd suggest to: - factor out the user backed and bvec cases from __iov_iter_get_pages_alloc into helper just to keep __iov_iter_get_pages_alloc readable. - for the pin case don't use the existing bvec helper at all, but copy the logic for the block layer for not pinning.