Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1931970pxa; Thu, 6 Aug 2020 21:17:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJQi2LjGVXGyHjVtUs9uAVCcJb7cGfaHzmWpzLIb/XN3xcI4JTCSoFue5eMWR9Il+jCMPm X-Received: by 2002:a50:ba8c:: with SMTP id x12mr7352477ede.319.1596773850102; Thu, 06 Aug 2020 21:17:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596773850; cv=none; d=google.com; s=arc-20160816; b=0vKhzdfrArn6Qe/QnoVPI6wzyO4ZHzTeJp1oQAjcxezv8eDp4Yi/iIV7N9AouSfDrB 7KdV0u2QmnJzvwqFNIwK/m5t9OBtQbSKl7ELNv2HT/Xgv0Qkyj508QF+viarYrVDa8Oe WF9aIJZSaPSBILpG5yxf/klBnQUUdTnhOUl/8yXlH9ErlUsOp/+9FxNVpkWsPsv7rFWF p6SHrdsznDMVwIKH2QMEed42uVyo2b1XhnB9FoHz1hyUV09tjSPnSgjIRrfJq2m1uqCM O8Y6OW2rYeUib0PnDu24LiYfsK3E51TmuMJE67bvCgKd8XpoAYSszoLg6yP6AkEhGNUx jTcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=yEAoBTfzA2t8ntfESpcsbhSVuvCCWj5v8ZUwF+1FJPE=; b=nf74JQYMoapwWH4G0Kvy91+3LIYFBBELgWxvLOSVyMCpfBAS0g3HqW2WwzlCwKP8zk cBuiRgfUwqpHWGcd40Uo8pkOF8+aoMnATXldVrshwCEInxEeDwWADB0+ZtX5C4zPp5qa Vvn1bspGDd1sucd8duq6ilAVP6lMcXk6yOTxolJQAnxMAYs0mhJK76Yes9iv1uYalMdK RjUnUoHqcjEvsSEBUDrzB7fd1dyuzG5OkIYVUB3SDX6+TH7fJ4LzQkD+EaBgfs0LmZDA XX4ccH0E348bSc1bmEx4Z9GWIoOOYtUxSGWvAcTR4aBgNY3poWk5SRxUmQVF0Wnsepdu B8PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=S7+UxFyp; 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 z14si4666078edk.480.2020.08.06.21.17.04; Thu, 06 Aug 2020 21:17:30 -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; dkim=pass header.i=@kernel.org header.s=default header.b=S7+UxFyp; 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 S1725845AbgHGEQH (ORCPT + 99 others); Fri, 7 Aug 2020 00:16:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:40918 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725379AbgHGEQG (ORCPT ); Fri, 7 Aug 2020 00:16:06 -0400 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?