]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.14.60/kvm-mm-account-shadow-page-tables-to-kmemcg.patch
Remove duplicated commits
[thirdparty/kernel/stable-queue.git] / releases / 4.14.60 / kvm-mm-account-shadow-page-tables-to-kmemcg.patch
CommitLineData
5b0b9568
GKH
1From d97e5e6160c0e0a23963ec198c7cb1c69e6bf9e8 Mon Sep 17 00:00:00 2001
2From: Shakeel Butt <shakeelb@google.com>
3Date: Thu, 26 Jul 2018 16:37:45 -0700
4Subject: kvm, mm: account shadow page tables to kmemcg
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9From: Shakeel Butt <shakeelb@google.com>
10
11commit d97e5e6160c0e0a23963ec198c7cb1c69e6bf9e8 upstream.
12
13The size of kvm's shadow page tables corresponds to the size of the
14guest virtual machines on the system. Large VMs can spend a significant
15amount of memory as shadow page tables which can not be left as system
16memory overhead. So, account shadow page tables to the kmemcg.
17
18[shakeelb@google.com: replace (GFP_KERNEL|__GFP_ACCOUNT) with GFP_KERNEL_ACCOUNT]
19 Link: http://lkml.kernel.org/r/20180629140224.205849-1-shakeelb@google.com
20Link: http://lkml.kernel.org/r/20180627181349.149778-1-shakeelb@google.com
21Signed-off-by: Shakeel Butt <shakeelb@google.com>
22Cc: Michal Hocko <mhocko@kernel.org>
23Cc: Johannes Weiner <hannes@cmpxchg.org>
24Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
25Cc: Paolo Bonzini <pbonzini@redhat.com>
26Cc: Greg Thelen <gthelen@google.com>
27Cc: Radim Krčmář <rkrcmar@redhat.com>
28Cc: Peter Feiner <pfeiner@google.com>
29Cc: <stable@vger.kernel.org>
30Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
31Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
32Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
33
34---
35 arch/x86/kvm/mmu.c | 2 +-
36 1 file changed, 1 insertion(+), 1 deletion(-)
37
38--- a/arch/x86/kvm/mmu.c
39+++ b/arch/x86/kvm/mmu.c
40@@ -890,7 +890,7 @@ static int mmu_topup_memory_cache_page(s
41 if (cache->nobjs >= min)
42 return 0;
43 while (cache->nobjs < ARRAY_SIZE(cache->objects)) {
44- page = (void *)__get_free_page(GFP_KERNEL);
45+ page = (void *)__get_free_page(GFP_KERNEL_ACCOUNT);
46 if (!page)
47 return -ENOMEM;
48 cache->objects[cache->nobjs++] = page;