Re: [PATCH 3/3] memcg: reduce size of memcg vmstats structures
From: Shakeel Butt
Date: Wed Sep 07 2022 - 22:35:35 EST
On Tue, Sep 6, 2022 at 9:36 PM Shakeel Butt <shakeelb@xxxxxxxxxx> wrote:
>
[...]
>
> static unsigned long memcg_events_local(struct mem_cgroup *memcg, int event)
> {
> long x = 0;
> int cpu;
> + int index = memcg_events_index(event);
> +
> + if (index < 0)
> + return 0;
>
> for_each_possible_cpu(cpu)
> x += per_cpu(memcg->vmstats_percpu->events[event], cpu);
Andrew, can you please replace 'event' in the above line with 'index'?
I had this correct in the original single patch but messed up while
breaking up that patch into three patches for easier review.