Re: [PATCH v2] mm: memcg: use rstat for non-hierarchical stats
From: Yosry Ahmed
Date: Wed Jul 26 2023 - 11:24:12 EST
On Wed, Jul 26, 2023 at 8:20 AM Johannes Weiner <hannes@xxxxxxxxxxx> wrote:
>
> On Tue, Jul 25, 2023 at 07:20:02PM -0700, Yosry Ahmed wrote:
> > On Tue, Jul 25, 2023 at 7:15 PM Roman Gushchin <roman.gushchin@xxxxxxxxx> wrote:
> > >
> > > On Wed, Jul 26, 2023 at 12:29:04AM +0000, Yosry Ahmed wrote:
> > > > Currently, memcg uses rstat to maintain hierarchical stats. Counters are
> > > > maintained for hierarchical stats at each memcg. Rstat tracks which
> > > > cgroups have updates on which cpus to keep those counters fresh on the
> > > > read-side.
> > > >
> > > > For non-hierarchical stats, we do not maintain counters. Instead, the
> > > global?
> >
> > Do you mean "we do not maintain global counters"? I think "global" is
> > confusing, because it can be thought of as all cpus or as including
> > the subtree (as opposed to local for non-hierarchical stats).
>
> "global" seems fine to me, I don't think it's ambiguous in the direct
> comparison with per-cpu counts.
>
> Alternatively, rephrase the whole thing? Something like:
>
> "Non-hierarchical stats are currently not covered by rstat. Their
> per-cpu counters are summed up on every read, which is expensive."
Rephrasing sounds good to me.
I will send a v3 with the correct commit log and collected Acks to
make Andrew's life easier.