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=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS 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 B6E35C3A5A6 for ; Mon, 26 Aug 2019 10:10:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 959BE21872 for ; Mon, 26 Aug 2019 10:10:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731332AbfHZKKq (ORCPT ); Mon, 26 Aug 2019 06:10:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46914 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731306AbfHZKKm (ORCPT ); Mon, 26 Aug 2019 06:10:42 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 72397300BEB0; Mon, 26 Aug 2019 10:10:42 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-227.ams2.redhat.com [10.36.116.227]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4E1C560920; Mon, 26 Aug 2019 10:10:40 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, David Hildenbrand , Andrew Morton , Vlastimil Babka , Dan Williams , Mel Gorman , Michal Hocko , Wei Yang , Johannes Weiner , Arun KS Subject: [PATCH v2 5/6] mm: Introduce for_each_zone_nid() Date: Mon, 26 Aug 2019 12:10:11 +0200 Message-Id: <20190826101012.10575-6-david@redhat.com> In-Reply-To: <20190826101012.10575-1-david@redhat.com> References: <20190826101012.10575-1-david@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Mon, 26 Aug 2019 10:10:42 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Allow to iterate all zones belonging to a nid. Cc: Andrew Morton Cc: Vlastimil Babka Cc: Dan Williams Cc: Mel Gorman Cc: Michal Hocko Cc: Wei Yang Cc: Johannes Weiner Cc: Arun KS Signed-off-by: David Hildenbrand --- include/linux/mmzone.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 8b5f758942a2..71f2b9b55069 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -1004,6 +1004,11 @@ extern struct zone *next_zone(struct zone *zone); ; /* do nothing */ \ else +#define for_each_zone_nid(zone, nid) \ + for (zone = (NODE_DATA(nid))->node_zones; \ + zone && zone_to_nid(zone) == nid; \ + zone = next_zone(zone)) + static inline struct zone *zonelist_zone(struct zoneref *zoneref) { return zoneref->zone; -- 2.21.0