Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp890287rwb; Thu, 22 Sep 2022 07:37:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4AATnVnlDTXETNIKTFpzdDYJMm4lKoAQTQqvphWrOFAv7fCAqt3IlGxCP9jq3Ie6HKvV0p X-Received: by 2002:a17:907:31ca:b0:780:2170:e08c with SMTP id xf10-20020a17090731ca00b007802170e08cmr3111223ejb.145.1663857465055; Thu, 22 Sep 2022 07:37:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663857465; cv=none; d=google.com; s=arc-20160816; b=D3XHVO5X4E2asWdpUrhkc2+jZ4gyn6KVggqXQbCf+/hBSo6Bz0Y95vfdAJyVIi1lPn Ln1QXvpcNbCaG0U011uQoSyHnANemRm0FF0UCA2rFsKq/w10asv+eLi/2d2s9HurEmzK B1ZTDpguPkvQR5WSLdAvDxlwV2FWcWVS1PT8+6Tux3aFsCYKE1Lac/DQNYrDfm5R2/5a cW9jBeCSwPaNX+cw+gbSIm/Gg0Y6YS2kaLqoEXE2mm7CVOB8qPA92+rPySEVD7K9MXps pjdX+PPapugxXG8OeEOs7I3uf7fbguysmmaeffhOrSwx4gJEmE4/J9Hyb1inpjLCP/CJ PnEg== 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=02+QEmbVk9AVv9jEQgWKTTpXwGOiCyNcTFilArR3/C0=; b=OOMJWZ0iqnouyxKmX40Cy8a7+oJ7NAT97arFVUE+OPVF5wjrVPUJoWdZPobUcl3rS2 USftpe4lCqQss0tyNBOjk5fWZAc3srldXMV9fOIWrSsCFhQtNO7MHfnzfGlK4CaG08DU 7jIncbYObgEudfg0ZUW+NndNfGCoamh1mHbtZvzHOPJvwbddbcb1hgTiEDp1SU+yKHko nPlNghZDvcseBSJXO8BgdIVwREBKwyu8p9CyyVaheByCWEVnvrQq6EDFglc2iSoaqUHW ktnKH6HlETAEB7sfiTua3a9zvr/TSM230XL5A86mS9tgGr/6FfydYgFzbw1cVnMJ8xdT vaGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=POG8m7fd; 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 cs15-20020a170906dc8f00b0077a34e40b1dsi5035514ejc.529.2022.09.22.07.37.14; Thu, 22 Sep 2022 07:37:45 -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=POG8m7fd; 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 S229911AbiIVOg2 (ORCPT + 99 others); Thu, 22 Sep 2022 10:36:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229893AbiIVOg1 (ORCPT ); Thu, 22 Sep 2022 10:36:27 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8846F50A0; Thu, 22 Sep 2022 07:36:26 -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=02+QEmbVk9AVv9jEQgWKTTpXwGOiCyNcTFilArR3/C0=; b=POG8m7fdprEJLvFevbUlMRiZP0 1WqOY/+mhbT6uL6MLBd2M+9I++CBs1HDQYdONcZ3V0xwcZgXu+85xDEBnJHS37XJJRnqcKLU0SsWp wkSvLy6u88CwMk1WkgPa4W0wmkxh4n+NUa7jKeQ0EKrIhFhPImmCug7TT8YbE/fz5n+sAqaTI7tjV IztsB6PCr1wt4VGkjoE3msb8tbK0qVBl9TTz1Jl8llcH2HiRHQyAR8QuHbde3VMsu+B+rpHNxG1E9 Tm4Vb0V7JkeAKKqqBB4tTzV1V5LOXBmYkriDO6x65Hk/KS4XGO8woeVzT+PoapOYprl1c4tyjSBeA RVCrwhGg==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1obNJI-00G5Be-RS; Thu, 22 Sep 2022 14:36:16 +0000 Date: Thu, 22 Sep 2022 07:36:16 -0700 From: Christoph Hellwig To: Al Viro Cc: Jan Kara , Christoph Hellwig , John Hubbard , Andrew Morton , Jens Axboe , Miklos Szeredi , "Darrick J . Wong" , Trond Myklebust , Anna Schumaker , 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: <103fe662-3dc8-35cb-1a68-dda8af95c518@nvidia.com> <20220906102106.q23ovgyjyrsnbhkp@quack3> <20220914145233.cyeljaku4egeu4x2@quack3> <20220915081625.6a72nza6yq4l5etp@quack3> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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 On Tue, Sep 20, 2022 at 06:02:11AM +0100, Al Viro wrote: > nvme target: nvme read requests end up with somebody allocating and filling > sglist, followed by reading from file into it (using ITER_BVEC). Then the > pages are sent out, presumably Yes. > . I would be very surprised if it turned out > to be anything other than anon pages allocated by the driver, but I'd like > to see that confirmed by nvme folks. Probably doesn't need pinning. They are anon pages allocated by the driver using sgl_alloc(). > drivers/target/target_core_file.c:292: iov_iter_bvec(&iter, is_write, aio_cmd->bvecs, sgl_nents, len); Same as nvme target. > The picture so far looks like we mostly need to take care of pinning when > we obtain the references from iov_iter_get_pages(). What's more, it looks > like ITER_BVEC/ITER_XARRAY/ITER_PIPE we really don't need to pin anything on > get_pages/pin_pages - they are already protected (or, in case of ITER_PIPE, > allocated by iov_iter itself and not reachable by anybody outside). That's what I've been trying to say for a while..