[Devel] [PATCH RHEL8 COMMIT] fbcon: use kvmalloc() for scrollback buffer

Konstantin Khorenko khorenko at virtuozzo.com
Tue Jun 1 20:29:51 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.34
------>
commit 43c6f58e11a94e7ad824035c8b05642c4e8079bb
Author: Konstantin Khorenko <khorenko at virtuozzo.com>
Date:   Tue Jun 1 20:29:50 2021 +0300

    fbcon: use kvmalloc() for scrollback buffer
    
    Scrollback frame buffer is rather big - 32K,
    so it requires 3rd order page, so let's use kvmalloc() instead of
    ordinary kmalloc() for it.
    
    https://pmc.acronis.com/browse/VSTOR-17781
    https://jira.sw.ru/browse/HCI-188
    
    Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
    
    Rebased to vz8:
     - fbcon.c was moved to drivers/video/fbdev/core/fbcon.c
    
    (cherry-picked from vz7 commit e60259bd950c ("fbcon: use kvmalloc() for
    scrollback buffer"))
    Signed-off-by: Andrey Zhadchenko <andrey.zhadchenko at virtuozzo.com>
---
 drivers/video/fbdev/core/fbcon.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index 5fb954737220..4316fd2051d2 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -980,7 +980,7 @@ static const char *fbcon_startup(void)
 			if (!softback_buf) {
 				softback_buf =
 				    (unsigned long)
-				    kmalloc(fbcon_softback_size,
+				    kvmalloc(fbcon_softback_size,
 					    GFP_KERNEL);
 				if (!softback_buf) {
 					fbcon_softback_size = 0;
@@ -989,7 +989,7 @@ static const char *fbcon_startup(void)
 			}
 		} else {
 			if (softback_buf) {
-				kfree((void *) softback_buf);
+				kvfree((void *) softback_buf);
 				softback_buf = 0;
 				softback_top = 0;
 			}
@@ -3553,7 +3553,7 @@ static void fbcon_exit(void)
 	struct fb_info *info;
 	int i, j, mapped;
 
-	kfree((void *)softback_buf);
+	kvfree((void *)softback_buf);
 	softback_buf = 0UL;
 
 	for (i = 0; i < FB_MAX; i++) {


More information about the Devel mailing list