[Devel] [PATCH RHEL COMMIT] kvm: use kvzalloc for struct kvm allocation

Konstantin Khorenko khorenko at virtuozzo.com
Thu Sep 30 16:04:05 MSK 2021


The commit is pushed to "branch-rh9-5.14.vz9.1.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after ark-5.14
------>
commit 2c8d98fcc713fba4ba95f7e8aef24f2e997ca477
Author: Vasiliy Averin <vvs at virtuozzo.com>
Date:   Thu Sep 30 16:04:05 2021 +0300

    kvm: use kvzalloc for struct kvm allocation
    
    struct kvm had increased in RHEL77 and triggeres hugh-order-allocation
    warning now.
    Let's switch to use kvzalloc to suppress this warning
    
    https://jira.sw.ru/browse/PSBM-97483
    
    Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
    
    (cherry picked from vz7 commit c665b2519fa2 ("kvm: use kvzalloc for struct kvm
    allocation"))
    
    Signed-off-by: Andrey Zhadchenko <andrey.zhadchenko at virtuozzo.com>
    
    (cherry picked from vz8 commit 4f73f93c1db7d082db53f21abda30575a73afa59)
    Signed-off-by: Andrey Zhadchenko <andrey.zhadchenko at virtuozzo.com>
---
 include/linux/kvm_host.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index ae7735b490b4..b9103940859a 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -1042,12 +1042,12 @@ void kvm_arch_pre_destroy_vm(struct kvm *kvm);
  */
 static inline struct kvm *kvm_arch_alloc_vm(void)
 {
-	return kzalloc(sizeof(struct kvm), GFP_KERNEL);
+	return kvzalloc(sizeof(struct kvm), GFP_KERNEL);
 }
 
 static inline void kvm_arch_free_vm(struct kvm *kvm)
 {
-	kfree(kvm);
+	kvfree(kvm);
 }
 #endif
 


More information about the Devel mailing list