Commit 8eead4f5 authored by Shakeel Butt's avatar Shakeel Butt Committed by Greg Kroah-Hartman

kvm, mm: account shadow page tables to kmemcg

commit d97e5e61 upstream.

The size of kvm's shadow page tables corresponds to the size of the
guest virtual machines on the system.  Large VMs can spend a significant
amount of memory as shadow page tables which can not be left as system
memory overhead.  So, account shadow page tables to the kmemcg.

Link: default avatarShakeel Butt <>
Cc: Michal Hocko <>
Cc: Johannes Weiner <>
Cc: Vladimir Davydov <>
Cc: Paolo Bonzini <>
Cc: Greg Thelen <>
Cc: Radim Krčmář <>
Cc: Peter Feiner <>
Cc: <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent ca6427fa
......@@ -890,7 +890,7 @@ static int mmu_topup_memory_cache_page(struct kvm_mmu_memory_cache *cache,
if (cache->nobjs >= min)
return 0;
while (cache->nobjs < ARRAY_SIZE(cache->objects)) {
page = (void *)__get_free_page(GFP_KERNEL);
page = (void *)__get_free_page(GFP_KERNEL_ACCOUNT);
if (!page)
return -ENOMEM;
cache->objects[cache->nobjs++] = page;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment