linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	 David Hildenbrand <david@redhat.com>,
	lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com,
	 rppt@kernel.org, surenb@google.com, mhocko@suse.com,
	linux-mm@kvack.org,  linux-kernel@vger.kernel.org,
	Hongyu Ning <hongyu.ning@linux.intel.com>,
	 stable@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Hannes Reinecke <hare@suse.de>,
	 Johannes Thumshirn <johannes.thumshirn@wdc.com>,
	Jens Axboe <axboe@kernel.dk>
Subject: Re: [PATCH] mm: Fix vmstat after removing NR_BOUNCE
Date: Thu, 29 May 2025 13:47:09 +0300	[thread overview]
Message-ID: <ow3adiccumedegsm4agxlvaiaq3ypeto42hxr4ln6v3zzluhyu@2cdoez7of6ic> (raw)
In-Reply-To: <7ae9e9f9-80e7-4285-83f0-a0946d238243@suse.cz>

On Thu, May 29, 2025 at 12:40:21PM +0200, Vlastimil Babka wrote:
> On 5/29/25 12:38, 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.
> > 
> > Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> > Reported-by: Hongyu Ning <hongyu.ning@linux.intel.com>
> > Fixes: 194df9f66db8 ("mm: remove NR_BOUNCE zone stat")
> > Cc: stable@vger.kernel.org
> > Cc: Christoph Hellwig <hch@lst.de>
> > Cc: Hannes Reinecke <hare@suse.de>
> > Cc: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> > Cc: Jens Axboe <axboe@kernel.dk>
> 
> Is there a way to add a BUILD_BUG_ON to catch a future case like this one?

There's

	BUILD_BUG_ON(ARRAY_SIZE(vmstat_text) < NR_VMSTAT_ITEMS);

in vmstat_start().

Making it strict != seems to do the trick for my config. But it requires
wider testing.

I can prepare a patch for that.

-- 
  Kiryl Shutsemau / Kirill A. Shutemov


  reply	other threads:[~2025-05-29 10:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250529103832.2937460-1-kirill.shutemov@linux.intel.com>
2025-05-29 10:40 ` Vlastimil Babka
2025-05-29 10:47   ` Kirill A. Shutemov [this message]
2025-05-29 10:51     ` Kirill A. Shutemov
2025-05-29 12:30       ` Konstantin Khlebnikov
2025-05-29 10:43 ` Jens Axboe
2025-05-29 11:59 ` kernel test robot
2025-05-29 12:09   ` Kirill A. Shutemov
2025-05-29 12:13 ` Vlastimil Babka
2025-05-29 12:22 ` Michal Hocko
2025-05-29 18:13 ` Shakeel Butt
2025-06-02  5:01 ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ow3adiccumedegsm4agxlvaiaq3ypeto42hxr4ln6v3zzluhyu@2cdoez7of6ic \
    --to=kirill.shutemov@linux.intel.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=david@redhat.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=hongyu.ning@linux.intel.com \
    --cc=johannes.thumshirn@wdc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=mhocko@suse.com \
    --cc=rppt@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox