Skip to content

Commit 496df3d

Browse files
Ben Widawskytorvalds
authored andcommitted
mm: add comments on pglist_data zones
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 <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Reviewed-by: Andrew Morton <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
1 parent cc989e7 commit 496df3d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

include/linux/mmzone.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,9 +660,21 @@ struct deferred_split {
660660
* per-zone basis.
661661
*/
662662
typedef struct pglist_data {
663+
/*
664+
* node_zones contains just the zones for THIS node. Not all of the
665+
* zones may be populated, but it is the full list. It is referenced by
666+
* this node's node_zonelists as well as other node's node_zonelists.
667+
*/
663668
struct zone node_zones[MAX_NR_ZONES];
669+
670+
/*
671+
* node_zonelists contains references to all zones in all nodes.
672+
* Generally the first zones will be references to this node's
673+
* node_zones.
674+
*/
664675
struct zonelist node_zonelists[MAX_ZONELISTS];
665-
int nr_zones;
676+
677+
int nr_zones; /* number of populated zones in this node */
666678
#ifdef CONFIG_FLAT_NODE_MEM_MAP /* means !SPARSEMEM */
667679
struct page *node_mem_map;
668680
#ifdef CONFIG_PAGE_EXTENSION

0 commit comments

Comments
 (0)