[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220908153731.d6ec2095c9d1f42ff5e8ec5c@linux-foundation.org>
Date: Thu, 8 Sep 2022 15:37:31 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Shakeel Butt <shakeelb@...gle.com>
Cc: Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...nel.org>,
Roman Gushchin <roman.gushchin@...ux.dev>,
Muchun Song <songmuchun@...edance.com>,
Cgroups <cgroups@...r.kernel.org>, Linux MM <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 3/3] memcg: reduce size of memcg vmstats structures
On Wed, 7 Sep 2022 19:35:10 -0700 Shakeel Butt <shakeelb@...gle.com> wrote:
> On Tue, Sep 6, 2022 at 9:36 PM Shakeel Butt <shakeelb@...gle.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.
No probs.
From: Andrew Morton <akpm@...ux-foundation.org>
Subject: memcg-reduce-size-of-memcg-vmstats-structures-fix
Date: Thu Sep 8 03:35:53 PM PDT 2022
fix memcg_events_local() array index, per Shakeel
Link: https://lkml.kernel.org/r/CALvZod70Mvxr+Nzb6k0yiU2RFYjTD=0NFhKK-Eyp+5ejd1PSFw@mail.gmail.com
Cc: Johannes Weiner <hannes@...xchg.org>
Cc: Michal Hocko <mhocko@...nel.org>
Cc: Muchun Song <songmuchun@...edance.com>
Cc: Roman Gushchin <roman.gushchin@...ux.dev>
Cc: Shakeel Butt <shakeelb@...gle.com>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
---
mm/memcontrol.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/mm/memcontrol.c~memcg-reduce-size-of-memcg-vmstats-structures-fix
+++ a/mm/memcontrol.c
@@ -921,7 +921,7 @@ static unsigned long memcg_events_local(
return 0;
for_each_possible_cpu(cpu)
- x += per_cpu(memcg->vmstats_percpu->events[event], cpu);
+ x += per_cpu(memcg->vmstats_percpu->events[index], cpu);
return x;
}
_
Powered by blists - more mailing lists