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=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=no 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 8963FC433DB for ; Thu, 11 Mar 2021 15:15:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 07AA464FAA for ; Thu, 11 Mar 2021 15:15:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 07AA464FAA Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 525628D02C4; Thu, 11 Mar 2021 10:15:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4D5A18D02B2; Thu, 11 Mar 2021 10:15:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 39E008D02C4; Thu, 11 Mar 2021 10:15:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0168.hostedemail.com [216.40.44.168]) by kanga.kvack.org (Postfix) with ESMTP id 1C08C8D02B2 for ; Thu, 11 Mar 2021 10:15:04 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id C8DCA8249980 for ; Thu, 11 Mar 2021 15:15:03 +0000 (UTC) X-FDA: 77907941286.15.4798C54 Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) by imf04.hostedemail.com (Postfix) with ESMTP id 86C3B3C5 for ; Thu, 11 Mar 2021 15:14:58 +0000 (UTC) Received: by mail-lf1-f42.google.com with SMTP id q25so40312576lfc.8 for ; Thu, 11 Mar 2021 07:14:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CelhTZTNo0tbpqSt2Sqgz71NShqrngcVDLph+CUo5CY=; b=gD/OAtHHjk1a+K+VhVVssr/6+LSb2m7YfCWg6rrdG2i8Trb1elLbsNJNtE4qJ4tbnl a+K0lhsiZb/SUdZRzOQdHoNwYrlyT6MU5rCYFX0ENyGUdmjTtlGsnG4LpUkdWWswAdXF NkMpSo4pdUGuh2spZF3FNOfKpXgga0EeRoeF4I7evS6n1/2vJCs4xZmNyITsVUfCzmmb xeieIb1wz2paeWPSThNMWAydadH+f6hyH47u6cP3swA6Va+axYIdl3pJ/3n7Jes9zcTr VncnHI9qhkYghY7yNzEW6n/CpCGsOQieTzlmnCuO1oVHMnCTwy/dfrbcl/LDPP6R7z3Z 0jBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CelhTZTNo0tbpqSt2Sqgz71NShqrngcVDLph+CUo5CY=; b=fiHEfoxA3wfYqkFSINteECWPWNP6+2zfRuPIi1JmOWRYC3/O5CWlzodQN5oSXLN456 Xeb2+vLWv6v3cCj5Sb0N76OjpYl9kFMvMpKnPhndFiuciK6QgG8+VZ/BXrEuKhtEjXO4 fPGiavjSTW2A5di6ldO3Q5WVia0L19P+Ee2d1d8KX7YxpmXlkhEd0UGRst5qzHhqDIHp jW0MDen4HV0v08qDvzcXaW4mdYEHSxzqxllnMnvzFKYzX5962k4eol1WrsFb3mRmXTKR SYUHle8Gd/S7aMk/GwAIjVOkqj6gmpHKMfVlW06/JysAhbLYbkNX7uk3O8WuO1sKm7Yx HstQ== X-Gm-Message-State: AOAM531ek0x5EJNvH6sG0kRR0YDHr+kOGZDQmguK/Vy3qKi3O8MZLiyu HQFD9TLYFS7rYyykEiwJ/po8F1yftFOZqLcx//EHRA== X-Google-Smtp-Source: ABdhPJyCLMLr/TnwzGAp6VToQf4LEk9+TSoYqjrRZUAg7/4gpPCA1hnLHCrGhPspDgSwZiCnOfU3j0ZUTBbEDkB1+U4= X-Received: by 2002:a19:ee19:: with SMTP id g25mr2457540lfb.83.1615475697434; Thu, 11 Mar 2021 07:14:57 -0800 (PST) MIME-Version: 1.0 References: <5affff71-e503-9fb9-50cb-f6d48286dd52@virtuozzo.com> <24a416f7-9def-65c9-599e-d56f7c328d33@virtuozzo.com> In-Reply-To: <24a416f7-9def-65c9-599e-d56f7c328d33@virtuozzo.com> From: Shakeel Butt Date: Thu, 11 Mar 2021 07:14:45 -0800 Message-ID: Subject: Re: [PATCH 0/9] memcg accounting from OpenVZ To: Vasily Averin Cc: Michal Hocko , Cgroups , Linux MM , Johannes Weiner , Vladimir Davydov Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 86C3B3C5 X-Stat-Signature: xzn6rrsonjp6ukh7gckiqcxns7xmwj5e Received-SPF: none (google.com>: No applicable sender policy available) receiver=imf04; identity=mailfrom; envelope-from=""; helo=mail-lf1-f42.google.com; client-ip=209.85.167.42 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615475698-889768 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Mar 10, 2021 at 11:00 PM Vasily Averin wrote: > > On 3/10/21 1:41 PM, Michal Hocko wrote: > > On Wed 10-03-21 13:17:19, Vasily Averin wrote: > >> On 3/10/21 12:12 AM, Shakeel Butt wrote: > >>> On Tue, Mar 9, 2021 at 12:04 AM Vasily Averin wrote: > >>>> > >>>> OpenVZ many years accounted memory of few kernel objects, > >>>> this helps us to prevent host memory abuse from inside memcg-limited container. > >>> > >>> The text is cryptic but I am assuming you wanted to say that OpenVZ > >>> has remained on a kernel which was still on opt-out kmem accounting > >>> i.e. <4.5. Now OpenVZ wants to move to a newer kernel and thus these > >>> patches are needed, right? > >> > >> Something like this. > >> Frankly speaking I badly understand which arguments should I provide to upstream > >> to enable accounting for some new king of objects. > >> > >> OpenVZ used own accounting subsystem since 2001 (i.e. since v2.2.x linux kernels) > >> and we have accounted all required kernel objects by using our own patches. > >> When memcg was added to upstream Vladimir Davydov added accounting of some objects > >> to upstream but did not skipped another ones. > >> Now OpenVZ uses RHEL7-based kernels with cgroup v1 in production, and we still account > >> "skipped" objects by our own patches just because we accounted such objects before. > >> We're working on rebase to new kernels and we prefer to push our old patches to upstream. > > > > That is certainly an interesting information. But for a changelog it > > would be more appropriate to provide information about how much memory > > user can induce and whether there is any way to limit that memory by > > other means. How practical those other means are and which usecases will > > benefit from the containment. > > Right now I would like to understand how should I argument my requests about > accounting of new kind of objects. > > Which description it enough to enable object accounting? > Could you please specify some edge rules? > Should I push such patches trough this list? > Is it probably better to send them to mailing lists of according subsystems? > Should I notify them somehow at least? > > "untrusted netadmin inside memcg-limited container can create unlimited number of routing entries, trigger OOM on host that will be unable to find the reason of memory shortage and kill huge" > > "each mount inside memcg-limited container creates non-accounted mount object, > but new mount namespace creation consumes huge piece of non-accounted memory for cloned mounts" > > "unprivileged user inside memcg-limited container can create non-accounted multi-page per-thread kernel objects for LDT" > > "non-accounted multi-page tty objects can be created from inside memcg-limited container" > > "unprivileged user inside memcg-limited container can trigger creation of huge number of non-accounted fasync_struct objects" > I think the above reasoning is good enough. Just resend your patches with the corresponding details.