Re: [PATCH 3/3] memcg: reduce size of memcg vmstats structures

Shakeel Butt
2022-09-08T02:35:26Z

On Tue, Sep 6, 2022 at 9:36 PM Shakeel Butt <shakeelb@google.com> 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.