Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6143685iog; Thu, 23 Jun 2022 12:15:07 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uw34a/odrJaITIoQPsgTNq108o6mpq2FPI0hJVjvh/rLHQNxfcaCjnfWuKUhZVAY95PLo6 X-Received: by 2002:a17:907:7e91:b0:721:9b87:7095 with SMTP id qb17-20020a1709077e9100b007219b877095mr9953693ejc.564.1656011707192; Thu, 23 Jun 2022 12:15:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656011707; cv=none; d=google.com; s=arc-20160816; b=pLQW7ml9KURM3vX991mPAN1E0nx11Xo90F25d9uyyd2Co+gxN7g3C8OPqfhwSPD/xF FpXqDkzX9Rl3cYTX9BpBWBhxmQMPpWDvV1qjhJfXluj84LToLythVye7RDrtzP32QjyR iaKXl9v6nR3w9hcsIAYwHeZPaNFhcB7xZR3R5nvN7jhuM30O051lGkkiP8LLWWS8oVS+ NOeobZyX5onXsheoCnTk1vKzsC+bVfnlJDOvbsTGkElxaKnWbcn4SQDIIa1l0dFKCWE8 hUAvERmFdgqU0IoD5kDlyVrVZpZj2uJP+cC3O+yRHFU/zC20k3bQazQQ7I8YA4uhwsRr zVLw== 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=UenEwcIN0CvVMMXweP0TWmC7AzLiwOHffKvm7rzsvxY=; b=T8D1KOylFlfjeqhLGsp18Qoq9nhM3hZFDJx/6dkZAshzxypoz3GIk/H4xxOI1PSAAy zjuQRLSxVAxfcExWqX0j/f7K8CMkgYL/dcoh/98HQLYeYUHWMxZ2K5BCgGbb7g1Ear0f piuciIVgR5sXYrqOCMHe3l6U6oBgTW98zwy2Go1ymNvJrydgwR9vXxqJWOCO4O7vhO+y PiIi2JBVqtgCR21LPp/NziOMRMcS2Vdgl8a6kRNlvKKNCqLKzP7Li7twaQTpqFY6p07e pIjSPoLOZ5Ad0Me4CsUyQxveHRI9C41YFxkBW+QltBkhnUIIznhxm4cSmDk9RfcGvOA7 ouLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=F60jZ0Di; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga21-20020a1709070c1500b007121b9fc6f9si23876942ejc.954.2022.06.23.12.14.41; Thu, 23 Jun 2022 12:15:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=F60jZ0Di; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233904AbiFWR3y (ORCPT + 99 others); Thu, 23 Jun 2022 13:29:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234011AbiFWR1i (ORCPT ); Thu, 23 Jun 2022 13:27:38 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04DF7506D6 for ; Thu, 23 Jun 2022 10:03:15 -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=UenEwcIN0CvVMMXweP0TWmC7AzLiwOHffKvm7rzsvxY=; b=F60jZ0DijvM0NLeHfLyAZLtO8B cbCSSryf/ZJyUOWsnEtUCDNiwnf8r9kSJNUJoyCOh8/JSjMgZzxWLo2l8nGB+M4V1I64oCbTL8pnG YD/LZs6YKE1Yq40e61dXoVn75QKBz2bsGHtBJwGqalXEPQiKoj5XIahiSxsGOtj/k+nMhmgwTgWW8 7XwYtcrrkIvSvlYu8Los43W1fSgc4MBXDNne0L/6KVVUHONYps1CLTuGkbV4Wx+68AKR3hm6oXagi 2hq7ITECWkzRHY60cGknvOTokRIsGqq0J+1DfEUZQyyIppBLROpiJW5iXocE8Cjnn9GKnJfD8B5kj 0+LhjxVw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1o4QER-0081dP-VH; Thu, 23 Jun 2022 17:03:03 +0000 Date: Thu, 23 Jun 2022 18:03:03 +0100 From: Matthew Wilcox To: David Hildenbrand Cc: Liam Howlett , "maple-tree@lists.infradead.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Andrew Morton , "damon @ lists . linux . dev" , SeongJae Park Subject: Re: [PATCH v10 09/69] mm: add VMA iterator Message-ID: References: <20220621204632.3370049-1-Liam.Howlett@oracle.com> <20220621204632.3370049-10-Liam.Howlett@oracle.com> <20192b57-30de-1426-6694-238e018104eb@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20192b57-30de-1426-6694-238e018104eb@redhat.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 21, 2022 at 11:10:09PM +0200, David Hildenbrand wrote: > > +#define VMA_ITERATOR(name, mm, addr) \ > > + struct vma_iterator name = { \ > > + .mas = { \ > > + .tree = &mm->mm_mt, \ > > + .index = addr, \ > > + .node = MAS_START, \ > > + }, \ > > + } > > + > > No __* and () macro magic? > > I'd have expected at least > > tree = &(__mm)->mm_mt, > .index = (__addr), > > ;) Fair, fair. Just testing that change now. I always forget to do those things until they bite me. > Reviewed-by: David Hildenbrand Appreciate the review! diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index acbd8d03e01e..8bcbffefdc02 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -686,11 +686,11 @@ struct vma_iterator { struct ma_state mas; }; -#define VMA_ITERATOR(name, mm, addr) \ +#define VMA_ITERATOR(name, _mm, _addr) \ struct vma_iterator name = { \ .mas = { \ - .tree = &mm->mm_mt, \ - .index = addr, \ + .tree = &(_mm)->mm_mt, \ + .index = (_addr), \ .node = MAS_START, \ }, \ }