Re: [PATCH -mmotm] memcg: implement memory thresholds documentfixes

From: KAMEZAWA Hiroyuki
Date: Thu Jan 07 2010 - 04:07:25 EST


On Thu, 7 Jan 2010 14:22:56 +0530
Balbir Singh <balbir@xxxxxxxxxxxxxxxxxx> wrote:

> * KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> [2010-01-07 10:18:05]:
>
> > On Thu, 7 Jan 2010 09:57:14 +0900
> > Daisuke Nishimura <nishimura@xxxxxxxxxxxxxxxxx> wrote:
> >
> > > Each memcg-implement-memory-thresholds.patch and
> > > memcg-add-interface-to-move-charge-at-task-migration.patch try to add a new
> > > section to Documentation/cgroup/memory.txt, so the document has been a bit
> > > mangled when these patches are merged at the same time.
> > >
> > > This patch fixes it.
> > >
> >
> > Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>
> >
> > BTW, I'll prepare total update for memcg (especially around percpu counter).
> > Do you have something may conflict in plan ?
>
> Kame, could you clarify percpu counter? Is this on for resource
> counter scalability patches I had?
>
No.

Now. memcg's percpu counter uses following code.
==
static inline void
__mem_cgroup_stat_set_safe(struct mem_cgroup_stat_cpu *stat,
enum mem_cgroup_stat_index idx, s64 val)
{
stat->count[idx] = val;
}
static int mem_cgroup_size(void)
{
int cpustat_size = nr_cpu_ids * sizeof(struct mem_cgroup_stat_cpu);
return sizeof(struct mem_cgroup) + cpustat_size;
}

static struct mem_cgroup *mem_cgroup_alloc(void)
{
struct mem_cgroup *mem;
int size = mem_cgroup_size();

if (size < PAGE_SIZE)
mem = kmalloc(size, GFP_KERNEL);
else
mem = vmalloc(size);

==

But this is not NUMA-aware and slow. i.e. BAD.

Now, we have good codes for percpu_alloc(). we should use it.

like this => http://patchwork.kernel.org/patch/58662/

Things will be simplified.
I need to rewrite all to catch up recent changes _AND_ we have to
detect why 2 seconds of overhead is added by threshold patches.
And hopefuly, reduce it. I think softlimit/threshold event counter
can be rewritten in unified clean way.

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/