]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mm: vmstat: output reserved_highatomic and free_highatomic in zoneinfo
authorJiayuan Chen <jiayuan.chen@linux.dev>
Mon, 27 Oct 2025 14:18:17 +0000 (22:18 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 17 Nov 2025 01:28:26 +0000 (17:28 -0800)
The nr_free_highatomic is a key factor in calculating watermarks as it
affects the free pages count.  Adding this metric, along with
nr_reserved_highatomic, to /proc/zoneinfo facilitates easier diagnosis
memory watermark calculations and memory pressure states.

Sample output:
cat /proc/zoneinfo
......
pagesets
cpu: 0
  count:    52069
  high:     52675
  batch:    63
  high_min: 13971
  high_max: 62284
vm stats threshold: 10
node_unreclaimable:  0
start_pfn:           4096
reserved_highatomic: 5120
free_highatomic:     2081

Link: https://lkml.kernel.org/r/20251027141818.283587-1-jiayuan.chen@linux.dev
Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Cc: David Hildenbrand <david@redhat.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/vmstat.c

index f226942db746aae38c3dcf22abd1e4b32e819688..b53b07aa29e813c75c1ab0172d878d3d0d72a705 100644 (file)
@@ -1852,9 +1852,13 @@ static void zoneinfo_show_print(struct seq_file *m, pg_data_t *pgdat,
        }
        seq_printf(m,
                   "\n  node_unreclaimable:  %u"
-                  "\n  start_pfn:           %lu",
+                  "\n  start_pfn:           %lu"
+                  "\n  reserved_highatomic: %lu"
+                  "\n  free_highatomic:     %lu",
                   atomic_read(&pgdat->kswapd_failures) >= MAX_RECLAIM_RETRIES,
-                  zone->zone_start_pfn);
+                  zone->zone_start_pfn,
+                  zone->nr_reserved_highatomic,
+                  zone->nr_free_highatomic);
        seq_putc(m, '\n');
 }