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 2EBE5C6FA92 for ; Thu, 22 Sep 2022 14:36:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229970AbiIVOg3 (ORCPT ); Thu, 22 Sep 2022 10:36:29 -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 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@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..