Re: [PATCH v3 2/2] mm: memcg: introduce new event to trace shrink_memcg

From: Shakeel Butt
Date: Sat Nov 25 2023 - 12:38:08 EST


On Sat, Nov 25, 2023 at 11:01:37AM +0300, Dmitry Rokosov wrote:
[...]
> > > + trace_mm_vmscan_memcg_shrink_begin(sc->order,
> > > + sc->gfp_mask,
> > > + memcg);
> > > +
> >
> > If you place the start of the trace here, you may have only the begin
> > trace for memcgs whose usage are below their min or low limits. Is that
> > fine? Otherwise you can put it just before shrink_lruvec() call.
> >
>
> From my point of view, it's fine. For situations like the one you
> described, when we only see the begin() tracepoint raised without the
> end(), we understand that reclaim requests are being made but cannot be
> satisfied due to certain conditions within memcg (such as limits).
>
> There may be some spam tracepoints in the trace pipe, which is a disadvantage
> of this approach.
>
> How important do you think it is to understand such situations? Or do
> you suggest moving the begin() tracepoint after the memcg limits checks
> and don't care about it?
>

I was mainly wondering if that is intentional. It seems like you as
first user of this trace has a need to know that a reclaim for a given
memcg was triggered but due to min/low limits no reclaim was done. This
is a totally reasonable use-case.