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 X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A71CC433ED for ; Fri, 9 Apr 2021 11:46:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CD7516115C for ; Fri, 9 Apr 2021 11:46:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CD7516115C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 692346B0072; Fri, 9 Apr 2021 07:46:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 641A86B0073; Fri, 9 Apr 2021 07:46:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4BC736B0074; Fri, 9 Apr 2021 07:46:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0141.hostedemail.com [216.40.44.141]) by kanga.kvack.org (Postfix) with ESMTP id 2BFCD6B0072 for ; Fri, 9 Apr 2021 07:46:08 -0400 (EDT) Received: from smtpin37.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id E18788248047 for ; Fri, 9 Apr 2021 11:46:07 +0000 (UTC) X-FDA: 78012649974.37.72ABAFF Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf25.hostedemail.com (Postfix) with ESMTP id D01DE600010D for ; Fri, 9 Apr 2021 11:46:05 +0000 (UTC) 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> X-Rspamd-Queue-Id: D01DE600010D X-Stat-Signature: ewjahuk5i3u7gsmyt53kbph88d9s3swc X-Rspamd-Server: rspam02 Received-SPF: none (infradead.org>: No applicable sender policy available) receiver=imf25; identity=mailfrom; envelope-from=""; helo=casper.infradead.org; client-ip=90.155.50.34 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1617968765-918534 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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"