From patchwork Wed May 20 20:54:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 11561565 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C93891391 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 9F2F82084C for ; Wed, 20 May 2020 20:54:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9F2F82084C 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) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id AC983900002; Wed, 20 May 2020 16:54:52 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org 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-Original-To: linux-mm@kvack.org 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-Spam-Summary: 1,0,0,,d41d8cd98f00b204,ben.widawsky@intel.com,,RULES_HIT:30012:30034:30054:30064:30090,0,RBL:134.134.136.20:@intel.com:.lbl8.mailshell.net-64.95.201.95 62.50.0.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:ft,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none 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 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