Re: [PATCH] Add file based RSS accounting for memory resourcecontroller (v2)

From: KAMEZAWA Hiroyuki
Date: Fri Apr 17 2009 - 02:57:53 EST


On Fri, 17 Apr 2009 12:17:26 +0530
Balbir Singh <balbir@xxxxxxxxxxxxxxxxxx> wrote:

> > *But* we still have following code.
> > ==
> > 820 static int __mem_cgroup_try_charge(struct mm_struct *mm,
> > 821 gfp_t gfp_mask, struct mem_cgroup **memcg,
> > 822
> > 834 /*
> > 835 * We always charge the cgroup the mm_struct belongs to.
> > 836 * The mm_struct's mem_cgroup changes on task migration if the
> > 837 * thread group leader migrates. It's possible that mm is not
> > 838 * set, if so charge the init_mm (happens for pagecache usage).
> > 839 */
> > 840 mem = *memcg;
> > 841 if (likely(!mem)) {
> > 842 mem = try_get_mem_cgroup_from_mm(mm);
> > 843 *memcg = mem;
> > 844 } else {
> > 845 css_get(&mem->css);
> > 846 }
> > 847 if (unlikely(!mem))
> > 848 return 0;
> > ==
> >
> > So, for _now_, we should use this style of checking page_cgroup is used or not.
> > Until we fix/confirm try_charge() does.
> >
>
> Hmm... I think we need to fix this loop hole, if not mem, we should
> look at charging the root cgroup. I suspect !mem cases should be 0,
> I'll keep that as a TODO.
>
yes, I'd like to keep this in my mind, too.


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/