From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19CB1C4338F for ; Tue, 27 Jul 2021 07:21:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F337E60238 for ; Tue, 27 Jul 2021 07:21:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235831AbhG0HVI (ORCPT ); Tue, 27 Jul 2021 03:21:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:42130 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235558AbhG0HVF (ORCPT ); Tue, 27 Jul 2021 03:21:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C934E60238; Tue, 27 Jul 2021 07:21:02 +0000 (UTC) Date: Tue, 27 Jul 2021 09:21:00 +0200 From: Christian Brauner To: Vasily Averin Cc: Andrew Morton , cgroups@vger.kernel.org, Michal Hocko , Shakeel Butt , Johannes Weiner , Vladimir Davydov , Roman Gushchin , Alexander Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v7 01/10] memcg: enable accounting for mnt_cache entries Message-ID: <20210727072100.4a3o6tcw7v5ot2lr@wittgenstein> References: <6f21a0e0-bd36-b6be-1ffa-0dc86c06c470@virtuozzo.com> <045db11f-4a45-7c9b-2664-5b32c2b44943@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <045db11f-4a45-7c9b-2664-5b32c2b44943@virtuozzo.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 27, 2021 at 08:33:12AM +0300, Vasily Averin wrote: > The kernel allocates ~400 bytes of 'strcut mount' for any new mount. > Creating a new mount namespace clones most of the parent mounts, > and this can be repeated many times. Additionally, each mount allocates > up to PATH_MAX=4096 bytes for mnt->mnt_devname. > > It makes sense to account for these allocations to restrict the host's > memory consumption from inside the memcg-limited container. > > Signed-off-by: Vasily Averin > --- Looks good. Thank you! Acked-by: Christian Brauner I wonder how much this increases reported memory consumption when you boot full system containers that run systemd and a bunch of systemd services that each use a separate mount namespace.