[Devel] [PATCH RHEL8 COMMIT] ms/memcg: drop GFP_KERNEL_ACCOUNT use in tty_save_termios()

Konstantin Khorenko khorenko at virtuozzo.com
Tue Jul 27 13:58:38 MSK 2021


The commit is pushed to "branch-rh8-4.18.0-305.3.1.vz8.7.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-305.3.1.el8
------>
commit da879874c63459447d5177f2781a30aa98399859
Author: Vasily Averin <vvs at virtuozzo.com>
Date:   Tue Jul 27 13:58:38 2021 +0300

    ms/memcg: drop GFP_KERNEL_ACCOUNT use in tty_save_termios()
    
    Jiri Slaby pointed that termios are not saved for PTYs and for other
    terminals used inside containers. Therefore accounting for saved
    termios have near to zero impact in real life scenarios.
    
    Fixes: 06fac184ac6b ("memcg: charge kmem allocations accounted to UBC in PCS6 to memcg")
    Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
---
 drivers/tty/tty_io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 9b4c2f1af10a..c263812715b5 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -1395,7 +1395,7 @@ void tty_save_termios(struct tty_struct *tty)
 	/* Stash the termios data */
 	tp = tty->driver->termios[idx];
 	if (tp == NULL) {
-		tp = kmalloc(sizeof(struct ktermios), GFP_KERNEL_ACCOUNT);
+		tp = kmalloc(sizeof(struct ktermios), GFP_KERNEL);
 		if (tp == NULL)
 			return;
 		tty->driver->termios[idx] = tp;


More information about the Devel mailing list