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=-5.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 D75D8C433DF for ; Fri, 7 Aug 2020 04:16:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 932F022CAF for ; Fri, 7 Aug 2020 04:16:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="S7+UxFyp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 932F022CAF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EFCC66B0002; Fri, 7 Aug 2020 00:16:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EAC4C6B0003; Fri, 7 Aug 2020 00:16:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DE9A76B0005; Fri, 7 Aug 2020 00:16:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id C5DC26B0002 for ; Fri, 7 Aug 2020 00:16:06 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 72A5C1EFF for ; Fri, 7 Aug 2020 04:16:06 +0000 (UTC) X-FDA: 77122459932.13.unit81_620565226fbd Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id 429D918140B60 for ; Fri, 7 Aug 2020 04:16:06 +0000 (UTC) X-HE-Tag: unit81_620565226fbd X-Filterd-Recvd-Size: 3435 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf48.hostedemail.com (Postfix) with ESMTP for ; Fri, 7 Aug 2020 04:16:05 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 526CF2086A; Fri, 7 Aug 2020 04:16:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596773764; bh=ku0mtRLPmN6NVNq3U53FKsGpwTHeRKVHnmHxSE42guc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=S7+UxFypRpe8o0zzl2NftpnwsYRS9AdI6vRChUDLAvWxMutLfNSNBIt7cTvBwn+8h xysgk+VIjLuAMPR1J6wpNZimmNWIZucpAcbGs5nqWK8oHkug4npsj+enYYU/4zDgrU rGPkX+Z7EbO57uBaZquCYaFvcJOeVxnjSrPYLWes= Date: Thu, 6 Aug 2020 21:16:03 -0700 From: Andrew Morton To: Michal =?ISO-8859-1?Q?Koutn=FD?= Cc: Roman Gushchin , Dennis Zhou , Tejun Heo , Christoph Lameter , Johannes Weiner , Michal Hocko , Shakeel Butt , linux-mm@kvack.org, kernel-team@fb.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 4/5] mm: memcg: charge memcg percpu memory to the parent cgroup Message-Id: <20200806211603.195727c03995c3a25ffc6d76@linux-foundation.org> In-Reply-To: <20200729171039.GA22229@blackbody.suse.cz> References: <20200623184515.4132564-1-guro@fb.com> <20200623184515.4132564-5-guro@fb.com> <20200729171039.GA22229@blackbody.suse.cz> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 429D918140B60 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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, 29 Jul 2020 19:10:39 +0200 Michal Koutn=FD wrote: > Hello. >=20 > On Tue, Jun 23, 2020 at 11:45:14AM -0700, Roman Gushchin wr= ote: > > Because the size of memory cgroup internal structures can dramatically > > exceed the size of object or page which is pinning it in the memory, it= 's > > not a good idea to simple ignore it. It actually breaks the isolation > > between cgroups. > No doubt about accounting the memory if it's significant amount. >=20 > > Let's account the consumed percpu memory to the parent cgroup. > Why did you choose charging to the parent of the created cgroup? >=20 > Should the charge go the cgroup _that is creating_ the new memcg? >=20 > One reason is that there are the throttling mechanisms for memory limits > and those are better exercised when the actor and its memory artefact > are the same cgroup, aren't they? >=20 > The second reason is based on the example Dlegation Containment > (Documentation/admin-guide/cgroup-v2.rst) >=20 > > For an example, let's assume cgroups C0 and C1 have been delegated to > > user U0 who created C00, C01 under C0 and C10 under C1 as follows and > > all processes under C0 and C1 belong to U0:: > >=20 > > ~~~~~~~~~~~~~ - C0 - C00 > > ~ cgroup ~ \ C01 > > ~ hierarchy ~ > > ~~~~~~~~~~~~~ - C1 - C10 >=20 > Thanks to permissions a task running in C0 creating a cgroup in C1 would > deplete C1's supply victimizing tasks inside C1. These week-old issues appear to be significant. Roman? Or someone else?