linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Konstantin Khlebnikov <koct9i@gmail.com>
To: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Vlastimil Babka <vbabka@suse.cz>,
	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 14:30:58 +0200	[thread overview]
Message-ID: <CALYGNiMBP5C0-6c_3MXpAEswYn8P6CH4eG3Kr5asu70uJg+CXg@mail.gmail.com> (raw)
In-Reply-To: <scchmajjawfmmoreihui4yyzuyutzf3evhmmx2j4f2lhu6r62n@ovaamezmqgun>

On Thu, 29 May 2025 at 12:51, Kirill A. Shutemov
<kirill.shutemov@linux.intel.com> wrote:
>
> On Thu, May 29, 2025 at 01:47:10PM +0300, Kirill A. Shutemov wrote:
> > 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.
>
> There was a strict check before 9d7ea9a297e6 ("mm/vmstat: add helpers to
> get vmstat item names for each enum type"). Not sure if changing != to <
> was intentional.
>
> Konstantin?

I have no clue. Sorry.

>
> --
>   Kiryl Shutsemau / Kirill A. Shutemov


  reply	other threads:[~2025-05-29 12:31 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
2025-05-29 10:51     ` Kirill A. Shutemov
2025-05-29 12:30       ` Konstantin Khlebnikov [this message]
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=CALYGNiMBP5C0-6c_3MXpAEswYn8P6CH4eG3Kr5asu70uJg+CXg@mail.gmail.com \
    --to=koct9i@gmail.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=kirill.shutemov@linux.intel.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