Re: [PATCH v2 0/5] Introduce memcg_stock_pcp remote draining

From: Michal Hocko
Date: Thu Jan 26 2023 - 14:14:10 EST


On Thu 26-01-23 15:14:25, Marcelo Tosatti wrote:
> On Thu, Jan 26, 2023 at 08:45:36AM +0100, Michal Hocko wrote:
> > On Wed 25-01-23 15:22:00, Marcelo Tosatti wrote:
> > [...]
> > > Remote draining reduces interruptions whether CPU
> > > is marked as isolated or not:
> > >
> > > - Allows isolated CPUs from benefiting of pcp caching.
> > > - Removes the interruption to non isolated CPUs. See for example
> > >
> > > https://lkml.org/lkml/2022/6/13/2769
> >
> > This is talking about page allocato per cpu caches, right? In this patch
> > we are talking about memcg pcp caches. Are you sure the same applies
> > here?
>
> Both can stall the users of the drain operation.

Yes. But it is important to consider who those users are. We are
draining when
- we are charging and the limit is hit so that memory reclaim
has to be triggered.
- hard, high limits are set and require memory reclaim.
- force_empty - full memory reclaim for a memcg
- memcg offlining - cgroup removel - quite a heavy operation as
well.
all those could be really costly kernel operations and they affect
isolated cpu only if the same memcg is used by both isolated and non-isolated
cpus. In other words those costly operations would have to be triggered
from non-isolated cpus and those are to be expected to be stalled. It is
the side effect of the local cpu draining that is scheduled that affects
the isolated cpu as well.

Is that more clear?
--
Michal Hocko
SUSE Labs