[Devel] Re: [RFC][PATCH] memory controller per zone patches take 2 [4/10] calculate mapped ratio for memory cgroup

YAMAMOTO Takashi yamamoto at valinux.co.jp
Thu Nov 22 00:34:20 PST 2007


> > > +	/* usage is recorded in bytes */
> > > +	total = mem->res.usage >> PAGE_SHIFT;
> > > +	rss = mem_cgroup_read_stat(&mem->stat, MEM_CGROUP_STAT_RSS);
> > > +	return (rss * 100) / total;
> > 
> > Never tried 64 bit division on a 32 bit system. I hope we don't
> > have to resort to do_div() sort of functionality.
> > 
> Hmm, maybe it's better to make these numebrs be just "long".
> I'll try to change per-cpu-counter implementation.
> 
> Thanks,
> -Kame

besides that, i think 'total' can be zero here.

YAMAMOTO Takashi
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list