linux-stable/arch/x86/kvm/vmx
Ben Gardon 4183683918 kvm: vmx: Add memcg accounting to KVM allocations
There are many KVM kernel memory allocations which are tied to the life of
the VM process and should be charged to the VM process's cgroup. If the
allocations aren't tied to the process, the OOM killer will not know
that killing the process will free the associated kernel memory.
Add __GFP_ACCOUNT flags to many of the allocations which are not yet being
charged to the VM process's cgroup.

Tested:
	Ran all kvm-unit-tests on a 64 bit Haswell machine, the patch
	introduced no new failures.
	Ran a kernel memory accounting test which creates a VM to touch
	memory and then checks that the kernel memory allocated for the
	process is within certain bounds.
	With this patch we account for much more of the vmalloc and slab memory
	allocated for the VM.

Signed-off-by: Ben Gardon <bgardon@google.com>
Reviewed-by: Shakeel Butt <shakeelb@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-02-20 22:48:31 +01:00
..
capabilities.h
evmcs.c x86/kvm/hyper-v: nested_enable_evmcs() sets vmcs_version incorrectly 2019-01-25 19:11:37 +01:00
evmcs.h
nested.c kvm: vmx: Add memcg accounting to KVM allocations 2019-02-20 22:48:31 +01:00
nested.h
ops.h
pmu_intel.c
vmcs.h KVM: nVMX: Cache host_rsp on a per-VMCS basis 2019-02-12 13:12:22 +01:00
vmcs12.c
vmcs12.h
vmcs_shadow_fields.h
vmenter.S KVM: VMX: Reorder clearing of registers in the vCPU-run assembly flow 2019-02-20 22:48:18 +01:00
vmx.c kvm: vmx: Add memcg accounting to KVM allocations 2019-02-20 22:48:31 +01:00
vmx.h kvm: vmx: Add memcg accounting to KVM allocations 2019-02-20 22:48:31 +01:00