lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALYGNiMBP5C0-6c_3MXpAEswYn8P6CH4eG3Kr5asu70uJg+CXg@mail.gmail.com>
Date: Thu, 29 May 2025 14:30:58 +0200
From: Konstantin Khlebnikov <koct9i@...il.com>
To: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
Cc: Vlastimil Babka <vbabka@...e.cz>, Andrew Morton <akpm@...ux-foundation.org>, 
	David Hildenbrand <david@...hat.com>, lorenzo.stoakes@...cle.com, Liam.Howlett@...cle.com, 
	rppt@...nel.org, surenb@...gle.com, mhocko@...e.com, linux-mm@...ck.org, 
	linux-kernel@...r.kernel.org, Hongyu Ning <hongyu.ning@...ux.intel.com>, 
	stable@...r.kernel.org, Christoph Hellwig <hch@....de>, Hannes Reinecke <hare@...e.de>, 
	Johannes Thumshirn <johannes.thumshirn@....com>, Jens Axboe <axboe@...nel.dk>
Subject: Re: [PATCH] mm: Fix vmstat after removing NR_BOUNCE

On Thu, 29 May 2025 at 12:51, Kirill A. Shutemov
<kirill.shutemov@...ux.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@...ux.intel.com>
> > > > Reported-by: Hongyu Ning <hongyu.ning@...ux.intel.com>
> > > > Fixes: 194df9f66db8 ("mm: remove NR_BOUNCE zone stat")
> > > > Cc: stable@...r.kernel.org
> > > > Cc: Christoph Hellwig <hch@....de>
> > > > Cc: Hannes Reinecke <hare@...e.de>
> > > > Cc: Johannes Thumshirn <johannes.thumshirn@....com>
> > > > Cc: Jens Axboe <axboe@...nel.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ