Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1278766pxf; Fri, 9 Apr 2021 04:46:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxn4RS/LCKq4xKF95S2z+tiO7BDcqTUdOni+dJWE9E7p6Yz8atB1vic7KglIOm7ri17OgGn X-Received: by 2002:a62:2742:0:b029:222:b711:3324 with SMTP id n63-20020a6227420000b0290222b7113324mr12046502pfn.7.1617968778494; Fri, 09 Apr 2021 04:46:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617968778; cv=none; d=google.com; s=arc-20160816; b=jDXn2rmKGz6Dcphhmdok/dpBGRCUPmRGPpZplWrMKRLSWEOXpnzem4r12hxTPF4G2m Uwmzuk1NybiFUJ5Y4ZNV8fGDPhkCTcaycam2FAWFa1O+lwvzI48CqcFhm2LOW0nKdBuA qf787Gqv8XFkqQgr7GsTqe7OuqlcKYMDwI1eSK7BLT4FHf/qczcQdNsh7teO+nZnZZyl vQ/n98KNn0qbeuXJULja0OYn+jqwFCwOZ0jN7WtNT24NZyTwh8xISxbnlqE3T2q7kFT+ tQ+XktnnFni6Z9WMVqPiuGQkEyMoEvz0+hO851q7HDH4IoXwYUAzTIdZBN7/i2eDzqlt WKhg== 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=c1r8qKf2WZUBFC6KK+MUpMLPvRW0EBtQK/vl4+qTDxg=; b=YKOCpF4fuDwBU0EWlnCRUormRAJe2PwCkluho2tNye04SSXC0CS8S1MBwmDm1DIUcl W/EefeWpvFk1FO4pGlGpRGJJbEO8R97aC3o1Sa0i10Miyf28H7CLveLy9oFFPM/82VUG R/eroZF0qwiXnQ7aiOLByDV6FfmDgS5AGxB+41eHo/WzkecP9ri0I83MvusUyCgQisFe 1UaIxzzJ2b/A7um/w4T76iNAIFRq8u6XRKdCHHe3kCjTKXRQX7tYNVAqwasSVtWYjHJf po2PP5RaNJYY7cKgnN0vqCUFxGa7KhKeWuSgx7OMXAc8hwnmhiP2CtZIKGqi6vcaTN2C ZYhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=NOPeCLY4; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 41si2954125pla.318.2021.04.09.04.45.58; Fri, 09 Apr 2021 04:46:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=NOPeCLY4; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233009AbhDILqG (ORCPT + 99 others); Fri, 9 Apr 2021 07:46:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231638AbhDILqG (ORCPT ); Fri, 9 Apr 2021 07:46:06 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2970C061760; Fri, 9 Apr 2021 04:45:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=c1r8qKf2WZUBFC6KK+MUpMLPvRW0EBtQK/vl4+qTDxg=; b=NOPeCLY4PZdlE1Sl+vERrsPYCI kaU09fmm4qGEaxVbWWYfFtOZ0dfLZ0wlHt1TzAnVRj0Z2OnnJiJQ0JujMFGZxOCpvd+X6kmCbo3AS s5+ioH0yGL6LgNWu2HItUFI8XLwGijzp9kyjepKmcaUnw64YW8EIvsTg/nnJn/u6n330Gve2P9cwj rXMtz0FIN995Nc8299Q4VfAqFO+HJOxpNwc+t30qega9f7aXSdDzrTspNvtwCRTmQ5YA6Ul7BgXXa UlbaHzCLXvvLEl1pr2Gck45gORD7uhzGD0ESWrGa2jpa3n0HxAGKyWlmP+ZsmPzLNoVPdMTj/I6Rm mdx5vNFA==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lUpZI-000Iht-4A; Fri, 09 Apr 2021 11:45:05 +0000 Date: Fri, 9 Apr 2021 12:44:56 +0100 From: Matthew Wilcox To: David Howells Cc: Al Viro , linux-fsdevel@vger.kernel.org, Christoph Hellwig , linux-mm@kvack.org, linux-cachefs@redhat.com, linux-afs@lists.infradead.org, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, Trond Myklebust , Anna Schumaker , Steve French , Dominique Martinet , Jeff Layton , David Wysochanski , linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 01/30] iov_iter: Add ITER_XARRAY Message-ID: <20210409114456.GT2531743@casper.infradead.org> References: <161789062190.6155.12711584466338493050.stgit@warthog.procyon.org.uk> <161789064740.6155.11932541175173658065.stgit@warthog.procyon.org.uk> <289825.1617959345@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <289825.1617959345@warthog.procyon.org.uk> Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Fri, Apr 09, 2021 at 10:09:05AM +0100, David Howells wrote: > Al Viro wrote: > > > > +#define iterate_all_kinds(i, n, v, I, B, K, X) { \ > > > > Do you have any users that would pass different B and X? > > > > > @@ -1440,7 +1665,7 @@ ssize_t iov_iter_get_pages_alloc(struct iov_iter *i, > > > return v.bv_len; > > > }),({ > > > return -EFAULT; > > > - }) > > > + }), 0 > > > > Correction - users that might get that flavour. This one explicitly checks > > for xarray and doesn't get to iterate_... in that case. > > This is the case for iterate_all_kinds(), but not for iterate_and_advance(). > > See _copy_mc_to_iter() for example: that can return directly out of the middle > of the loop, so the X variant must drop the rcu_read_lock(), but the B variant > doesn't need to. You also can't just use break to get out as the X variant > has a loop within a loop to handle iteration over the subelements of a THP. "Why does it need a loop? bvecs can contain multi-page vectors" "memcpy_from_page can't handle that" "doesn't that mean that iterating over a bvec is already broken?" "yes"