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, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT 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 D1EE4C433DF for ; Wed, 20 May 2020 20:54:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5FC6320756 for ; Wed, 20 May 2020 20:54:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5FC6320756 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B17D480007; Wed, 20 May 2020 16:54:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AC983900002; Wed, 20 May 2020 16:54:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9DD9480007; Wed, 20 May 2020 16:54:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0043.hostedemail.com [216.40.44.43]) by kanga.kvack.org (Postfix) with ESMTP id 845D6900002 for ; Wed, 20 May 2020 16:54:52 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 2487E181AEF23 for ; Wed, 20 May 2020 20:54:52 +0000 (UTC) X-FDA: 76838301624.28.ship38_d457564fdb2c X-HE-Tag: ship38_d457564fdb2c X-Filterd-Recvd-Size: 2818 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Wed, 20 May 2020 20:54:51 +0000 (UTC) IronPort-SDR: JusQ1AogWMLmjv7oWUCl5u4r5y5PH7Be4oDp6EtGc6Djflz4CNe4oab3yfBvikpcLamqE/N+Pi FEXUnCmp3Vhg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 May 2020 13:54:49 -0700 IronPort-SDR: v5YHtNfZfeVqSguV4BHjPwHntwZI1tPC8x5HCY7hsCL6NEqJSrozIK+V004+j/6TDCwLp2T+qw lh59YXqCfVVw== X-IronPort-AV: E=Sophos;i="5.73,415,1583222400"; d="scan'208";a="253778036" Received: from viniciof-mobl.amr.corp.intel.com (HELO bwidawsk-mobl5.local) ([10.252.131.121]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 May 2020 13:54:49 -0700 From: Ben Widawsky To: linux-mm@kvack.org Cc: Dave Hansen , Andrew Morton , Ben Widawsky Subject: [PATCH] mm: add comments on pglist_data zones Date: Wed, 20 May 2020 13:54:43 -0700 Message-Id: <20200520205443.2757414-1-ben.widawsky@intel.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: While making other modifications it was easy to confuse the two struct members node_zones and node_zonelists. For those already familiar with the code, this might seem to be a silly patch, but it's quite helpful to disambiguate the similar-sounding fields While here, add a small comment on why nr_zones isn't simply MAX_NR_ZONES Signed-off-by: Ben Widawsky --- include/linux/mmzone.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git include/linux/mmzone.h include/linux/mmzone.h index 1b9de7d220fb..4f7c95e9bad8 100644 --- include/linux/mmzone.h +++ include/linux/mmzone.h @@ -665,9 +665,21 @@ struct deferred_split { * per-zone basis. */ typedef struct pglist_data { + /* + * node_zones contains just the zones for THIS node. Not all of the + * zones may be populated, but it is the full list. It is referenced by + * this node's node_zonelists as well as other node's node_zonelists. + */ struct zone node_zones[MAX_NR_ZONES]; + + /* + * node_zonelists contains references to all zones in all nodes. + * Generally the first zones will be references to this node's + * node_zones. + */ struct zonelist node_zonelists[MAX_ZONELISTS]; - int nr_zones; + + int nr_zones; /* number of populated zones in this node */ #ifdef CONFIG_FLAT_NODE_MEM_MAP /* means !SPARSEMEM */ struct page *node_mem_map; #ifdef CONFIG_PAGE_EXTENSION --=20 2.26.2