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

Konstantin Khorenko khorenko at virtuozzo.com
Thu Jun 17 18:18:02 MSK 2021


The commit is pushed to "branch-rh8-4.18.0-240.1.1.vz8.5.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-240.1.1.vz8.5.44
------>
commit 3818667ca61502834a7b67c079802459d8749baf
Author: Vasiliy Averin <vvs at virtuozzo.com>
Date:   Thu Jun 17 18:18:02 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>
---
 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 cad5f2cec162..1852612548a3 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -915,12 +915,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