lkml.org 
[lkml]   [2008]   [Nov]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] memcg: reduce size of per-cpu-stat to be appropriate size.
On Fri, 14 Nov 2008 13:13:29 +0530
Balbir Singh <balbir@linux.vnet.ibm.com> wrote:

> KAMEZAWA Hiroyuki wrote:
> > How about this one ?
> > tested on x86-64 + mmotm-Nov10, works well.
> > (test on other arch is welcome.)
> >
> > -Kame
> > ==
> > As Jan Blunck <jblunck@suse.de> pointed out, allocating
> > per-cpu stat for memcg to the size of NR_CPUS is not good.
> >
> > This patch changes mem_cgroup's cpustat allocation not based
> > on NR_CPUS but based on nr_cpu_ids.
> >
> > From: Jan Blunck <jblunck@suse.de>
> > Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> >
> > ---
> > mm/memcontrol.c | 34 ++++++++++++++++++----------------
> > 1 file changed, 18 insertions(+), 16 deletions(-)
> >
> > Index: mmotm-2.6.28-Nov10/mm/memcontrol.c
> > ===================================================================
> > --- mmotm-2.6.28-Nov10.orig/mm/memcontrol.c
> > +++ mmotm-2.6.28-Nov10/mm/memcontrol.c
> > @@ -60,7 +60,7 @@ struct mem_cgroup_stat_cpu {
> > } ____cacheline_aligned_in_smp;
> >
> > struct mem_cgroup_stat {
> > - struct mem_cgroup_stat_cpu cpustat[NR_CPUS];
> > + struct mem_cgroup_stat_cpu cpustat[0];
> > };
> >
> > /*
> > @@ -129,11 +129,10 @@ struct mem_cgroup {
> >
> > int prev_priority; /* for recording reclaim priority */
> > /*
> > - * statistics.
> > + * statistics. This must be placed at the end of memcg.
> > */
> > struct mem_cgroup_stat stat;
> > };
> > -static struct mem_cgroup init_mem_cgroup;
> >
> > enum charge_type {
> > MEM_CGROUP_CHARGE_TYPE_CACHE = 0,
> > @@ -1292,42 +1291,45 @@ static void free_mem_cgroup_per_zone_inf
> > kfree(mem->info.nodeinfo[node]);
> > }
> >
> > +static int mem_cgroup_size(void)
>
> inline this function?
>
necessary ?

> Other than that, I think the cont->parent check for freeing has already been
> spotted and pointed out
>
Ah, yes. fixed in v2.

Thanks,
-Kame



\
 
 \ /
  Last update: 2008-11-14 08:51    [W:0.056 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site