Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp297737imm; Thu, 13 Sep 2018 21:22:06 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb01YsRRk3AHfOJrvp8TOJXjsPbZghyrMwTiymW8lrRoljl/97jUcB6x/dMHDKYM027Lmrd X-Received: by 2002:a63:df04:: with SMTP id u4-v6mr10041992pgg.434.1536898926156; Thu, 13 Sep 2018 21:22:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536898926; cv=none; d=google.com; s=arc-20160816; b=v95OKKrIwCqtWGXphiVray9Y8oFlFHnw6/MYTPBSiNQHEodicJoMBVavg9r6u8RyI3 K5a7x7yaqTvbkO9RDj3KaDTr0TokS7ZaqDm9285ztbfP7YAWGph43Wt1C8Iao7ND3osW 2jtNMp0GV0FMPl0RqgUn3hws0c+xKZBTcgANtsAJrQCd3DP+THVcT89rTNAjOM5sdDin Po5FD5V8d6nM8oyzdT4+UULz8c5X6yo05JH9g6JlMOSuKNp0qVLasHaH1IHL23APwgHG +J5LDoKTQzEIG1kJ4QljOszHz+dounHSE6w72yykJTtEzMJvC+daWu1K9mYYSEYmmxYi I0+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=HXf1JA4LGefVsg0Xo3pNbLrfa9SpbjMkTwb5vc0Z27E=; b=zNbW5b6OI42Qi7uACd8Zf5MC+iq3YSCOWYVslz91WubT695bZcVclxJUPys+6eb6Dp 5KxQrEKZoOZqqgTm0sVhhc6snXwlMk0CxroFzn7WCKTgBvoqsphu+sCFh854Yf+HuOUk Z5q35148KKuHWatpkesooxqu+GXrnS5B0KeZ9X9501n//why2F+JON+OXPpDGqDXSlvQ sQmppCk57XkiWIFC/IFzHWcYrT6TEQlnkQ7BVX580QzhT64fdazV1L6oEeWbMmZUoit/ Ag+C40UIss+bEK2KfiGLOE8gtWhQujp+kuB3fOThOQs9n9Ca96PblExdADED+Q1AK/Aj 7Jyw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d3-v6si6090432pla.37.2018.09.13.21.21.50; Thu, 13 Sep 2018 21:22:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728153AbeINJbJ (ORCPT + 99 others); Fri, 14 Sep 2018 05:31:09 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:49302 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726911AbeINJbJ (ORCPT ); Fri, 14 Sep 2018 05:31:09 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1g0fYu-0003io-3e; Fri, 14 Sep 2018 04:18:32 +0000 Date: Fri, 14 Sep 2018 05:18:32 +0100 From: Al Viro To: David Howells Cc: linux-fsdevel@vger.kernel.org, linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 04/10] iov_iter: Add mapping and discard iterator types Message-ID: <20180914041831.GY19965@ZenIV.linux.org.uk> References: <153685389564.14766.11306559824641824935.stgit@warthog.procyon.org.uk> <153685392942.14766.3347355712333618914.stgit@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <153685392942.14766.3347355712333618914.stgit@warthog.procyon.org.uk> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 13, 2018 at 04:52:09PM +0100, David Howells wrote: > Add two new iterator types to iov_iter: > > (1) ITER_MAPPING > > This walks through a set of pages attached to an address_space that > are pinned or locked, starting at a given page and offset and walking > for the specified amount of space. A facility to get a callback each > time a page is entirely processed is provided. > > This is useful for copying data from socket buffers to inodes in > network filesystems. Interesting... Questions: * what will hold those pages? IOW, where will you unlock/drop/whatnot those sucker? * "callback" sounds dangerous - it appears to imply that you won't copy to/from the same page twice. Not true for a lot of iov_iter users; what happens if you pass such a beast to them? * why not simply "build and populate ITER_BVEC aliasing a piece of mapping", possibly in "grab" and "grab+lock" variants? Those ITER_MAPPING do seem to be related to ITER_BVEC, at the very least. Note, BTW, that iov_iter_get_pages...() might mutate into something similar - "build and populate ITER_BVEC aliasing a piece of given iov_iter". Or, perhaps, a nicer-on-memory analogue of ITER_BVEC - with instead of as elements, with the same "populate from mapping" to get something similar to your functionality and "populate from iov_iter" for iov_iter_get_pages... replacement.