On 03/12/2013 02:09 PM, Sha Zhengju wrote: > If memcg is enabled and no non-root memcg exists, all allocated pages > belong to root_mem_cgroup and go through root memcg statistics routines > which brings some overheads. > > So for the sake of performance, we can give up accounting stats of root > memcg for MEM_CGROUP_STAT_CACHE/RSS and instead we pay special attention > to memcg_stat_show() while showing root memcg numbers: > as we don't account root memcg stats anymore, the root_mem_cgroup->stat > numbers are actually 0. So we fake these numbers by using stats of global > state and all other memcg. That is for root memcg: > > nr(MEM_CGROUP_STAT_CACHE) = global_page_state(NR_FILE_PAGES) - > sum_of_all_memcg(MEM_CGROUP_STAT_CACHE); > > Rss pages accounting are in the similar way. > Well, The problem is that statistics is not the only cause for overhead. We will still incur in in the whole charging operation, and the same for uncharge. There is memory overhead from page_cgroup, etc. So my view is that this patch is far from complete. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>