[Devel] [PATCH RHEL7 COMMIT] ms/memcg: drop GFP_KERNEL_ACCOUNT use in tty_free_termios()

Vasily Averin vvs at virtuozzo.com
Thu Sep 2 20:20:46 MSK 2021


The commit is pushed to "branch-rh7-3.10.0-1160.41.1.vz7.183.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1160.41.1.vz7.183.1
------>
commit a727b00eccdb742c2d7f357d84c55581364a0c34
Author: Vasily Averin <vvs at virtuozzo.com>
Date:   Thu Sep 2 20:20:46 2021 +0300

    ms/memcg: drop GFP_KERNEL_ACCOUNT use in tty_free_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.
    
    Taken from upstream commit ("memcg: drop GFP_KERNEL_ACCOUNT use in tty_save_termios()")
    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 cd5d134..a31366b 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -1555,7 +1555,7 @@ void tty_free_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) {
 			pr_warn("tty: no memory to save termios state.\n");
 			return;


More information about the Devel mailing list