Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1286671ybg; Wed, 29 Jul 2020 10:11:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYVzkM5u+3NKiCp1Mu+jpHuhqANyHRTPVKTr+LftpFWmvRLB7NB2sw74ONhxzJ39hHumNt X-Received: by 2002:a05:6402:b6c:: with SMTP id cb12mr32273679edb.116.1596042686371; Wed, 29 Jul 2020 10:11:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596042686; cv=none; d=google.com; s=arc-20160816; b=f4tBstZC2YttQArqVyEyggwSDaZ+v7V22xbNkRm5wV0SAqMpu7XG44wa5c1OMvUYzX NE6FnPcMfqobwWOrqK+ZYXg1cUeJvBOc/1UPNGFmv166YZkL8mOB5+iLF3ayVmuSRwZL gjQBpHGrtZC9xH0fY66iFMZiucrTzaTTfCvvpigsce9bQk3i75YNud4SHDUO9mzpE9UN kP7dPG1rtpc3B2l5xrWsIRRnMBhGJGAIKJKvyUwZPFxY3a5ClQx/V6dW6L10n+haGn3Q q6m/nUMkmPtRMw7NDxtU8rq8FCa/8ZqKJ1v2in9NgtEJFg4JGhQcsqV5criG7TkZ75m6 3skw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=x2e2HFyeHXdtcFmJ91mZ2VA8OfDTWCPeEe9kBjk7noQ=; b=WMvFMR1VOIedovTFnDbU5OyyH9KjTTs4ICUwhMQj7b3v4fayXWcNvFvdMwtDwrlJVm PDtHVFOkyMiZlBfbMyKWil6O4u6bqM1P8/hwHCwD8Tr4H+K/OVUfMGsIOLpX36lX7EbL jKZTa8OIqmr+23HfVewVYML0Le1sevfsAVIBK0NuL49XY9/2m+idxPrRlhGaypsa8g5Y nBrD4RzHmMOmdbeGd3hgbHWTw6BNxrUN3YsBk976wWBJYHuZEfIDruMxLTKeH3M6E0/b LmM+liUvsHGNZlOWhlCdjdmZ1NJqQPmdO22gpTxz5fxbf0BiDUAIC1ZvTsem3DgbZz82 jd5g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f9si1745180ejl.71.2020.07.29.10.11.03; Wed, 29 Jul 2020 10:11:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726496AbgG2RKo (ORCPT + 99 others); Wed, 29 Jul 2020 13:10:44 -0400 Received: from mx2.suse.de ([195.135.220.15]:48132 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726336AbgG2RKo (ORCPT ); Wed, 29 Jul 2020 13:10:44 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id BC4DDB61F; Wed, 29 Jul 2020 17:10:54 +0000 (UTC) Date: Wed, 29 Jul 2020 19:10:39 +0200 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: Roman Gushchin Cc: Andrew Morton , 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: <20200729171039.GA22229@blackbody.suse.cz> References: <20200623184515.4132564-1-guro@fb.com> <20200623184515.4132564-5-guro@fb.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="DocE+STaALJfprDB" Content-Disposition: inline In-Reply-To: <20200623184515.4132564-5-guro@fb.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --DocE+STaALJfprDB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello. On Tue, Jun 23, 2020 at 11:45:14AM -0700, Roman Gushchin wrot= e: > 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. > Let's account the consumed percpu memory to the parent cgroup. Why did you choose charging to the parent of the created cgroup? Should the charge go the cgroup _that is creating_ the new memcg? 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? The second reason is based on the example Dlegation Containment (Documentation/admin-guide/cgroup-v2.rst) > 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 Thanks to permissions a task running in C0 creating a cgroup in C1 would deplete C1's supply victimizing tasks inside C1. Thanks, Michal --DocE+STaALJfprDB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEEoQaUCWq8F2Id1tNia1+riC5qSgFAl8hrYkACgkQia1+riC5 qShtTA//dhKi3k9H0xpR/7khFKk2fKfBTbe4ytbNMi6D2tazOviab/BzzzLP3CGl TmEuiPjCMDa6wt8KolxhzyI4eSqGA3dRtMeh4NKNnuns3LvGpPT4rm+RgTq03rRO b/KpXc8YFjhVvCRzp9JmvA15M4OrgIBCZikh5flY5AKEGmTcijop2gtOCeT7AzM8 Uo3jsO/D8lYGuWLfhb6ZNvvgqB5WcyfQWdWcSMq2LAxr3iVI3EJv5HQIkkVtE5e9 jpn+rDhgxzEk59IqzBSu7SQXuHTCfZWnQYSKMw4d64ld0cDPtOpx1ZkWhEWyqduI nvN119dUu8ChTwjg+l1ihkcrgQSyyKZnkTMBm7lx0/cOSKjquL9JB2wgnA7kLUHn D/WtbhcBTyal+OvlHRpFslgIV85w1keW7qooqusCglFFKDMANvEakmcH56MWSpjH Z5AfaYqjkmLoCyBHJqGYkMH8i3uDGtiyzG/WklPcVFdgk1oUzGLXIJNzTTZ//4hj ixm5bQFWowvtxdh6UOal1f2RCDb9hXviZ7Pnjey4yEi9Rehi/twxGSsHELNSTjxL /AGhNpF4WAX+Q4ZYsItchDkCxdGxzsa8lIbqAjx/9vgFHkZ/zk9dZKwNNpSP0jat JTlq2XBwqdlwvOK+JjWXCUSCzbXalVyBPaXgWT86TXwZ5TD5mp0= =4DMX -----END PGP SIGNATURE----- --DocE+STaALJfprDB--