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=-3.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 6F738C433E0 for ; Wed, 20 May 2020 23:22:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 229AF20759 for ; Wed, 20 May 2020 23:22:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="G3RvGqNJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 229AF20759 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AE33780008; Wed, 20 May 2020 19:22:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A9A1C900002; Wed, 20 May 2020 19:22:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9A6B580008; Wed, 20 May 2020 19:22:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0171.hostedemail.com [216.40.44.171]) by kanga.kvack.org (Postfix) with ESMTP id 7EC31900002 for ; Wed, 20 May 2020 19:22:40 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 327148245571 for ; Wed, 20 May 2020 23:22:40 +0000 (UTC) X-FDA: 76838674080.05.flag76_8ba6ae3e4c711 X-HE-Tag: flag76_8ba6ae3e4c711 X-Filterd-Recvd-Size: 3324 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Wed, 20 May 2020 23:22:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=gYUkaNgWOYCHRUTQyUFpyQ+GDtZa3Qrgm458WuzQYPI=; b=G3RvGqNJvDm/7DWftRNxhHNSpo iisrQkSwVafuBETAqb5vrU26iYIqNEKVEfbZN5c6WhRGOyqkMAc5gotBAYoamBDmZQ1jS7SgK4Bo6 ot+5sDg967Cx7DGU/QMKyvVsW5wtqxpdijEWjtUh9VyfzTRUgbX2rhr8l/oFtNwdMsR7OWa+eLDbC oMbukdvUh2jpfa479jR8A9ST4grSolG5CuCcQzqwHCKLOmvNh36xMKORFJT6Cg0pZIl+00+NtbQo+ BBa0b4gZrFRMJkd7giTn2HKBLW/6vBIp9GnaYFeTCGvy+wS08kTFAJ6HPKh888OtGGpWqd1hu5ht0 gyF4ORDQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jbY2l-0005jV-SS; Wed, 20 May 2020 23:22:35 +0000 Date: Wed, 20 May 2020 16:22:35 -0700 From: Matthew Wilcox To: Ben Widawsky Cc: linux-mm@kvack.org, Dave Hansen , Andrew Morton Subject: Re: [PATCH] mm: add comments on pglist_data zones Message-ID: <20200520232235.GD16070@bombadil.infradead.org> References: <20200520205443.2757414-1-ben.widawsky@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200520205443.2757414-1-ben.widawsky@intel.com> 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: On Wed, May 20, 2020 at 01:54:43PM -0700, Ben Widawsky wrote: > 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 It seems like a real shame to write all this excellent documentation and not format it as kernel-doc. > 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 > -- > 2.26.2 > >