Messages in this thread | | | Date | Fri, 17 Apr 2009 15:56:08 +0900 | From | KAMEZAWA Hiroyuki <> | Subject | Re: [PATCH] Add file based RSS accounting for memory resource controller (v2) |
| |
On Fri, 17 Apr 2009 12:17:26 +0530 Balbir Singh <balbir@linux.vnet.ibm.com> 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
| |