Re: [PATCH 3/7] memcg: add memory.scan_stat

From: KAMEZAWA Hiroyuki
Date: Sun Jun 26 2011 - 21:59:57 EST


On Fri, 24 Jun 2011 14:40:42 -0700
Ying Han <yinghan@xxxxxxxxxx> wrote:

> On Tue, Jun 21, 2011 at 5:20 PM, KAMEZAWA Hiroyuki
> <kamezawa.hiroyu@xxxxxxxxxxxxxx> wrote:
> > On Mon, 20 Jun 2011 23:49:54 -0700
> > Ying Han <yinghan@xxxxxxxxxx> wrote:
> >
> >> On Wed, Jun 15, 2011 at 8:53 PM, KAMEZAWA Hiroyuki <
> >> kamezawa.hiroyu@xxxxxxxxxxxxxx> wrote:
> >>
> >> > From e08990dd9ada13cf236bec1ef44b207436434b8e Mon Sep 17 00:00:00 2001
> >> > From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>
> >> > Date: Wed, 15 Jun 2011 14:11:01 +0900
> >> > Subject: [PATCH 3/7] memcg: add memory.scan_stat

> >> > +
> >> > +struct scanstat {
> >> > +    spinlock_t   Âlock;
> >> > +    unsigned long  stats[NR_SCANSTATS];  Â/* local statistics */
> >> > +    unsigned long  totalstats[NR_SCANSTATS];  /* hierarchical */
> >> > +};
>
> I wonder why not extending the mem_cgroup_stat_cpu struct, and then we
> can use the per-cpu counters like others.
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index b7d2d79..5b8bbe9 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -138,6 +138,7 @@ struct mem_cgroup_stat_cpu {
> long count[MEM_CGROUP_STAT_NSTATS];
> unsigned long events[MEM_CGROUP_EVENTS_NSTATS];
> unsigned long targets[MEM_CGROUP_NTARGETS];
> + unsigned long reclaim_stats[MEMCG_RECLAIM_NSTATS];
> };
>

Hmm, do we have enough benefit to consume 72 bytes per cpu and make
read-side slow for this rarely updated counter ?

Thanks,
-Kame

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/