diff mbox series

kvm: account allocation in generic version of kvm_arch_alloc_vm()

Message ID Y3aay2u2KQgiR0un@p183 (mailing list archive)
State New, archived
Headers show
Series kvm: account allocation in generic version of kvm_arch_alloc_vm() | expand

Commit Message

Alexey Dobriyan Nov. 17, 2022, 8:34 p.m. UTC
This is persistent allocation and arch-specific versions account it.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 include/linux/kvm_host.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sean Christopherson Nov. 18, 2022, 5:30 p.m. UTC | #1
Nit, please capitalize "KVM:" in the shortlog.

On Thu, Nov 17, 2022, Alexey Dobriyan wrote:
> 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.

> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> ---

With a reworded changelog,

Reviewed-by: Sean Christopherson <seanjc@google.com>
Sean Christopherson Jan. 19, 2023, 9:04 p.m. UTC | #2
On Thu, 17 Nov 2022 23:34:19 +0300, Alexey Dobriyan wrote:
> 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
diff mbox series

Patch

--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -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