This is just an RFC for dumping my queue to share and get better idea. Patch order may not be clean. Advice is welcomed. Now, struct page_cgroup is defined as == struct page_cgroup { unsigned long flags; struct mem_cgroup *mem_cgroup; }; == We want to remove ->flags to shrink the size (and integrate into 'struct page'). To do that, we need to remove some flags. Now, flag is defined as == PCG_LOCK, /* Lock for pc->mem_cgroup and following bits. */ PCG_CACHE, /* charged as cache */ PCG_USED, /* this object is in use. */ PCG_MIGRATION, /* under page migration */ /* flags for mem_cgroup and file and I/O status */ PCG_MOVE_LOCK, /* For race between move_account v.s. following bits */ PCG_FILE_MAPPED, /* page is accounted as "mapped" */ == We have 6bits now. This patch series removes PCG_CACHE, PCG_MOVE_LOCK, PCG_FILE_MAPPED. Then, if we use low 3bits of ->mem_cgroup for PCG_LOCK, PCG_USED, PCG_MIGRATION, we can remove pc->flags, I guess. To remove flags, this patch modifes page-stat accounting. After this set, per-memcg page stat accounting will be mem_cgroup_begin_update_page_stat() --(A) modify page status mem_cgroup_update_page_stat() mem_cgroup_end_update_page_stat() --(B) Between (A) and (B), it's guaranteed the page's pc->mem_cgroup will not be moved. By this change, move_account() can make use of page's information rather than page_cgroup's flag and we don't have to duplicate flags in page_cgroup. I think this is saner and allow us to add more per-memcg vmstat without any new flags. I'm now testing but don't see additional overheads. Thanks, -Kame -- To unsubscribe from this list: send the line "unsubscribe cgroups" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html