Re: [PATCH v2 2/7] memcg: dynamically allocate lruvec_stats

From: Roman Gushchin
Date: Mon Apr 29 2024 - 17:06:36 EST


On Mon, Apr 29, 2024 at 12:46:32PM -0700, Shakeel Butt wrote:
> On Mon, Apr 29, 2024 at 08:50:11AM -0700, Roman Gushchin wrote:
> > On Fri, Apr 26, 2024 at 05:37:28PM -0700, Shakeel Butt wrote:
> [...]
>
> > > + return x;
> > > +}
> > > +
> > > /* Subset of vm_event_item to report for memcg event stats */
> > > static const unsigned int memcg_vm_event_stat[] = {
> > > PGPGIN,
> > > @@ -5492,18 +5546,25 @@ static int alloc_mem_cgroup_per_node_info(struct mem_cgroup *memcg, int node)
> > > if (!pn)
> > > return 1;
> > >
> > > + pn->lruvec_stats = kzalloc_node(sizeof(struct lruvec_stats), GFP_KERNEL,
> > > + node);
> >
> > Why not GFP_KERNEL_ACCOUNT?
> >
>
> Previously struct lruvec_stats was part of struct mem_cgroup_per_node
> and we use GFP_KERNEL to allocate struct mem_cgroup_per_node. I kept the
> behavior same and if we want to switch to GFP_KERNEL_ACCOUNT, I think it
> should be a separate patch.

Agree. Here is the patch:

--