kvm: account allocation in generic version of kvm_arch_alloc_vm()
PATCH 1/1 kvm: account allocation in generic version of kvm_arch_alloc_vm()
This is persistent allocation and arch-specific versions account it.
---
include/linux/kvm_host.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/kvm_host.h +1 -1
@@ -1466,7 +1466,7 @@ int kvm_arch_create_vm_debugfs(struct kvm *kvm);*/ static inline struct kvm *kvm_arch_alloc_vm (void ) { -return kzalloc (sizeof (struct kvm ),GFP_KERNEL ); +return kzalloc (sizeof (struct kvm ),GFP_KERNEL_ACCOUNT ); }#endif
Nit, please capitalize "KVM:" in the shortlog.
Quoted 1 line · Alexey Dobriyan
This is persistent allocation and arch-specific versions account it.
The justification isn't that "x86 does it", e.g. the x86 code could be wrong. The justification is that the allocation is tied to the current task as opposed to being a KVM-wide allocation. It's worth calling out that x86 already accounts its allocation, but that should be a footnote, not the reason for converting the generic allocation.
Quoted 2 lines
Signed-off-by Alexey Dobriyan <[email protected]>---
With a reworded changelog,
Quoted 3 lines · Alexey Dobriyan
This is persistent allocation and arch-specific versions account it.
Applied to kvm-x86 generic, thanks!
[1/1] kvm: account allocation in generic version of kvm_arch_alloc_vm()
https://github.com/kvm-x86/linux/commit/9370e39e6b0a
--
https://github.com/kvm-x86/linux/tree/next
https://github.com/kvm-x86/linux/tree/fixes