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=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 6ACD6C433ED for ; Fri, 9 Apr 2021 09:09:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EF26661104 for ; Fri, 9 Apr 2021 09:09:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EF26661104 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 77AB16B0070; Fri, 9 Apr 2021 05:09:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 73E6B6B0071; Fri, 9 Apr 2021 05:09:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 62D146B0072; Fri, 9 Apr 2021 05:09:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0038.hostedemail.com [216.40.44.38]) by kanga.kvack.org (Postfix) with ESMTP id 465A66B0070 for ; Fri, 9 Apr 2021 05:09:18 -0400 (EDT) Received: from smtpin34.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 0962DA8CF for ; Fri, 9 Apr 2021 09:09:18 +0000 (UTC) X-FDA: 78012254796.34.D234B95 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf29.hostedemail.com (Postfix) with ESMTP id DB2B413A for ; Fri, 9 Apr 2021 09:09:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617959357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=t4HrPUNe1C2/eoGUl35UTxwdBVeab2D940Ztg0ThcXw=; b=jVA6JXZoEM9wkcd0KGGOA2q8+u3ycuhjyKPPI83v5T4gw2E90JgWNAk0B8KWrlLfkpzGEV 2BhI9Us1zj1aE/WIdhMJ8BFJSmYU6QHWzB6j0Dbux8BKQFgOJTogITZXVYnDeg7Lzo4+Yi 8jp89GJQ1EQrRKdl+w16BFzlN9Yt0TA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-315-DWcyR59bPNm8maj44EYDXw-1; Fri, 09 Apr 2021 05:09:15 -0400 X-MC-Unique: DWcyR59bPNm8maj44EYDXw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 455B9107ACC7; Fri, 9 Apr 2021 09:09:13 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-119-35.rdu2.redhat.com [10.10.119.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 529765D9E3; Fri, 9 Apr 2021 09:09:06 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <161789062190.6155.12711584466338493050.stgit@warthog.procyon.org.uk> <161789064740.6155.11932541175173658065.stgit@warthog.procyon.org.uk> To: Al Viro Cc: dhowells@redhat.com, linux-fsdevel@vger.kernel.org, "Matthew Wilcox (Oracle)" , 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 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <289824.1617959345.1@warthog.procyon.org.uk> Date: Fri, 09 Apr 2021 10:09:05 +0100 Message-ID: <289825.1617959345@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: DB2B413A X-Stat-Signature: kikqugu3uoa4wd4sgdrs3zhtjs7k9y99 Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf29; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=216.205.24.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1617959355-187086 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: 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. But with iterate_all_kinds(), I could just drop the X parameter and use the B parameter for both, I think. David