On Tue, Feb 23, 2010 at 04:58:07PM +0900, KAMEZAWA Hiroyuki wrote: > I'm not sure but....where this *hpage is chareged to proper memcg ? > I think it's good to charge this newpage in the top of this function. > (And cancel it at failure, of course.) That is just a temporary page owned by khugepaged, not owned by any memcg user. Who should I account it against? If allocation fails khugepaged just waits alloc_sleep_msec and tries again later. When the allocated page is actually used to collapse an hugepage, an amount of memory equal to the size of the hpage is released. In turn khugepaged changes nothing in the memcg accounting. There's just this hpage temporary page that is also released if you turn off khugepaged via sysctl, and I wouldn't know who to account it against. While it's true it takes 512 more space than the khugepaged kernel stack, conceptually it's the same thing as the kernel stack of the kernel thread, so by that argument we should account khugepaged 4k of kernel stack too. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxxx For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>