From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vasily Averin Subject: [PATCH v2 7/8] memcg: accounting for tty_struct objects Date: Mon, 15 Mar 2021 15:23:53 +0300 Message-ID: <61134897-703e-a2a8-6f0b-0bf6e1b79dda@virtuozzo.com> References: Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z7Z6F+cv0Ao5paKpXOnMEoUI/whyUVLKmV0vrccOiW8=; b=JQSccNvLt7KbafrVn3px+lm5uCHJJrAXMQzAXiNRIVdjpbMz+u6Qolr3JFo3DMh7jSjaLQ7ZnMzQT3jn2tqyM0nvPpz6ux/MPE/Qw94D8cQ1MXE6V+4p7GeiUGnzMWCS4V8fi05qCRBFn/lQvclIpWpTuRrHGgwtSMRWG/ID4qo= In-Reply-To: Content-Language: en-US List-ID: Content-Type: text/plain; charset="us-ascii" To: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Michal Hocko Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, Johannes Weiner , Vladimir Davydov , Shakeel Butt , Greg Kroah-Hartman , Jiri Slaby Non-accounted multi-page tty-related kenrel objects can be created from inside memcg-limited container. --- drivers/tty/tty_io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 74733ec..a3b881b 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -1503,7 +1503,7 @@ void tty_save_termios(struct tty_struct *tty) /* Stash the termios data */ tp = tty->driver->termios[idx]; if (tp == NULL) { - tp = kmalloc(sizeof(*tp), GFP_KERNEL); + tp = kmalloc(sizeof(*tp), GFP_KERNEL_ACCOUNT); if (tp == NULL) return; tty->driver->termios[idx] = tp; @@ -3128,7 +3128,7 @@ struct tty_struct *alloc_tty_struct(struct tty_driver *driver, int idx) { struct tty_struct *tty; - tty = kzalloc(sizeof(*tty), GFP_KERNEL); + tty = kzalloc(sizeof(*tty), GFP_KERNEL_ACCOUNT); if (!tty) return NULL; -- 1.8.3.1