Skip to contentSkip to conversation

kvm: account allocation in generic version of kvm_arch_alloc_vm()

PATCH Applied Alexey Dobriyan 2 participants 3 messages Nov 17, 2022 – Jan 19, 2023 KVM

lore
Share & tools
lore
#0 lore raw

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
 
reviewer Reviewed-by on v1 1/1
#1 lore raw

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

---

With a reworded changelog,