kvm, mm: account kvm related kmem slabs to kmemcg
authorShakeel Butt <shakeelb@google.com>
Fri, 6 Oct 2017 01:07:24 +0000 (18:07 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Dec 2017 13:26:25 +0000 (14:26 +0100)
commitf3a68b4b82f3f19b80b84cf11753082e7fb6ec8f
tree0ea1e0df06a26f1f0d898f6b9dbb2b4500381a24
parentaf826fdfb14c51fc4416993d0fcef8f4aa43b54c
kvm, mm: account kvm related kmem slabs to kmemcg

[ Upstream commit 46bea48ac241fe0b413805952dda74dd0c09ba8b ]

The kvm slabs can consume a significant amount of system memory
and indeed in our production environment we have observed that
a lot of machines are spending significant amount of memory that
can not be left as system memory overhead. Also the allocations
from these slabs can be triggered directly by user space applications
which has access to kvm and thus a buggy application can leak
such memory. So, these caches should be accounted to kmemcg.

Signed-off-by: Shakeel Butt <shakeelb@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/mmu.c
virt/kvm/kvm_main.c