kvm, mm: account shadow page tables to kmemcg
Subsystems (5)
PATCH 1/1 kvm, mm: account shadow page tables to kmemcg
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.
Signed-off-by Shakeel Butt <[email protected]>
--- arch/x86/kvm/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/mmu.c +1 -1
@@ -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 |__GFP_ACCOUNT);if (!page)return -ENOMEM ; cache->objects[cache->nobjs++] = page;
Signature · 1 line
2.18.0.rc2.346.g013aa6912e-goog
Paolo Bonzini
maintainerQuoted 16 lines · Shakeel Butt
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.
Signed-off-by Shakeel Butt <[email protected]>--- arch/x86/kvm/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/kvm/mmu.c +0
-0
arch/x86/kvm/mmu.c static int mmu_topup_memory_cache_page(struct kvm_mmu_memory_cache *cache, · line 896
Quoted 8 lines
arch/x86/kvm/mmu.c +1
-1@@ -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 |__GFP_ACCOUNT);if (!page)return -ENOMEM ; cache->objects[cache->nobjs++] = page;
Queued, with
Thanks,
Paolo