diff options
author | Shakeel Butt <shakeelb@google.com> | 2018-07-26 19:37:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-07-26 22:38:03 -0400 |
commit | d97e5e6160c0e0a23963ec198c7cb1c69e6bf9e8 (patch) | |
tree | 6e26bb4801d0a06e33023463939455002311bb32 | |
parent | 16e536ef47f567289a5699abee9ff7bb304bc12d (diff) |
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.
[shakeelb@google.com: replace (GFP_KERNEL|__GFP_ACCOUNT) with GFP_KERNEL_ACCOUNT]
Link: http://lkml.kernel.org/r/20180629140224.205849-1-shakeelb@google.com
Link: http://lkml.kernel.org/r/20180627181349.149778-1-shakeelb@google.com
Signed-off-by: Shakeel Butt <shakeelb@google.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Greg Thelen <gthelen@google.com>
Cc: Radim Krčmář <rkrcmar@redhat.com>
Cc: Peter Feiner <pfeiner@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | arch/x86/kvm/mmu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index d594690d8b95..6b8f11521c41 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -890,7 +890,7 @@ static int mmu_topup_memory_cache_page(struct kvm_mmu_memory_cache *cache, | |||
890 | if (cache->nobjs >= min) | 890 | if (cache->nobjs >= min) |
891 | return 0; | 891 | return 0; |
892 | while (cache->nobjs < ARRAY_SIZE(cache->objects)) { | 892 | while (cache->nobjs < ARRAY_SIZE(cache->objects)) { |
893 | page = (void *)__get_free_page(GFP_KERNEL); | 893 | page = (void *)__get_free_page(GFP_KERNEL_ACCOUNT); |
894 | if (!page) | 894 | if (!page) |
895 | return -ENOMEM; | 895 | return -ENOMEM; |
896 | cache->objects[cache->nobjs++] = page; | 896 | cache->objects[cache->nobjs++] = page; |