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]
Date: Mon, 6 May 2024 12:22:31 -0700
From: Yosry Ahmed <yosryahmed@...gle.com>
To: David Hildenbrand <david@...hat.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>, Shakeel Butt <shakeel.butt@...ux.dev>, 
	Johannes Weiner <hannes@...xchg.org>, Michal Hocko <mhocko@...nel.org>, 
	Roman Gushchin <roman.gushchin@...ux.dev>, Muchun Song <muchun.song@...ux.dev>, linux-mm@...ck.org, 
	cgroups@...r.kernel.org, linux-kernel@...r.kernel.org, 
	syzbot+9319a4268a640e26b72b@...kaller.appspotmail.com
Subject: Re: [PATCH] mm: do not update memcg stats for NR_{FILE/SHMEM}_PMDMAPPED

On Mon, May 6, 2024 at 12:18 PM David Hildenbrand <david@...hat.com> wrote:
>
> On 06.05.24 20:52, Yosry Ahmed wrote:
> > On Mon, May 6, 2024 at 11:35 AM David Hildenbrand <david@...hatcom> wrote:
> >>
> >> On 06.05.24 19:00, Yosry Ahmed wrote:
> >>> Do not use __lruvec_stat_mod_folio() when updating NR_FILE_PMDMAPPED and
> >>> NR_SHMEM_PMDMAPPED as these stats are not maintained per-memcg. Use
> >>> __mod_node_page_state() instead, which updates the global per-node stats
> >>> only.
> >>
> >> What's the effect of this? IIUC, it's been that way forever, no?
> >
> > Yes, but it has been the case that all the NR_VM_EVENT_ITEMS stats
> > were maintained per-memcg, although some of those fields are not
> > exposed anywhere.
> >
> > Shakeel recently added commit14e0f6c957e39 ("memcg: reduce memory for
> > the lruvec and memcg stats"), which changed this such that we only
> > maintain the stats we actually expose per-memcg (via a translation
> > table).
>
> Valuable information we should add to the patch description :)
>
> >
> > He also added commit 514462bbe927b ("memcg: warn for unexpected events
> > and stats"), which warns if we try to update a stat per-memcg that we
> > do not maintain per-memcg (i.e. the warning firing here). The goal is
> > to make sure the translation table has all the stats it needs to have.
> >
> > Both of these commits were just merged today into mm-stable, hence the
> > need for the fix now. It is the warning working as intended. No Fixes
> > or CC stable are needed, but if necessary I would think:
>
> WARN* should usually be "Fixes:"d, because WARN* expresses a condition
> that shouldn't be happening.
>
> Documentation/process/coding-style.rst contains details.
>
> >
> > Fixes: 514462bbe927b ("memcg: warn for unexpected events and stats")
> >
> > , because without the warning, the stat update will just be ignored.
> > So if anything the warning should have been added *after* this was
> > fixed up.
>
> Ideally, yes. But if it's in mm-stable, we usually can no longer
> reshuffle patches (commit IDs stable).

I will send v2 shortly with the missing negative sign, amended commit
log, and the Fixes tag.

Thanks for taking a look!


> --
> Cheers,
>
> David / dhildenb
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ