On Thu, May 29, 2025 at 01:38:32PM +0300, Kirill A. Shutemov wrote:
Hongyu noticed that the nr_unaccepted counter kept growing even in the absence of unaccepted memory on the machine.
This happens due to a commit that removed NR_BOUNCE: it removed the counter from the enum zone_stat_item, but left it in the vmstat_text array.
As a result, all counters below nr_bounce in /proc/vmstat are shifted by one line, causing the numa_hit counter to be labeled as nr_unaccepted.
To fix this issue, remove nr_bounce from the vmstat_text array.
Ooops, yes:
Reviewed-by: Christoph Hellwig hch@lst.de
diff --git a/mm/vmstat.c b/mm/vmstat.c index 4c268ce39ff2..ae9882063d89 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -1201,7 +1201,6 @@ const char * const vmstat_text[] = { "nr_zone_unevictable", "nr_zone_write_pending", "nr_mlock",
- "nr_bounce",
#if IS_ENABLED(CONFIG_ZSMALLOC) "nr_zspages", #endif
It would be really useful if such pretty printing arrays used named initializers, as that would make it obvious that an entry needs removal.