Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp484753pxa; Tue, 11 Aug 2020 07:51:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJze+4WKVLLv7xGV4J5+rz2DKQ8YdG2lA3hYD92E+wcNlHyh/xjtO5tAXv9ZI/UgsYxsfuud X-Received: by 2002:aa7:cd08:: with SMTP id b8mr27007021edw.228.1597157509510; Tue, 11 Aug 2020 07:51:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597157509; cv=none; d=google.com; s=arc-20160816; b=AKhvtnpxwHEI+1+RVDvC5cdYg1u30kXwy/S/S3VautEr2kGxeZcy06B4mdpDVf4LPe CfgJLAUlA9MXRntGRogZENmaDQOe+eEr42x3wMdZLVxhPhPVUpo+u/JAD6WmzgyjkwCO 5rOZSsS/ZTgVBDD9PpKh0gXfZP7DHpcLxq84J+27xUPN74ZTg3Tv5rgBVbmVLs3zBODn +tMZfmiCS61iWM9odbnQ6ZmMUbXErjBPAE7BebFnYIRk3vTYyW9pCVftwymHhUII797u K36uJy2uzeTqGSleEh+ZiphQz0sLNSFtM3op3p1hXmkGY98MjqgTVkR4XwP5wg7Ia7On OcCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=kKMS9UTHf0Kyz6Y4tsh9LUtJnKPhJb7sCBnhwa5cj0I=; b=gJNwJzmOk3MSQscYfnhAryldeRpOyGrheHSeYF/LL7D73HZCef1hwgGL5j7y+idDjN Ho08IuH1hkkszXCUD0C96gJlY8+S4TAlH8UKKUg6ulK96Iz0jgeMEZAwfsSMFvqInXI0 F3hbwwLD8SCeU0bMPCV1tpnz0IGwg/UUaqpcdPSm67jpaw3hql1mWRtBrWFCAmQ6Jjqt CiHCKuQZwsmbIcntm4UTPgVJ1KsBCHEJfHhMZNXGVsHOvjdo+R1hpor+sjLMNC5Z+QPq Hl89odluMrBskTjMXn1GyYMhuSya8DX2YkNTzSKQmPZgG3xW6+ojxs2KXdEvciDlI2N/ Qs9w== 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 r9si11770306ejp.629.2020.08.11.07.51.25; Tue, 11 Aug 2020 07:51:49 -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 S1728903AbgHKOsB (ORCPT + 99 others); Tue, 11 Aug 2020 10:48:01 -0400 Received: from mx2.suse.de ([195.135.220.15]:47112 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728794AbgHKOsA (ORCPT ); Tue, 11 Aug 2020 10:48:00 -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 CB4FAACDF; Tue, 11 Aug 2020 14:48:19 +0000 (UTC) Date: Tue, 11 Aug 2020 16:47:54 +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: <20200811144754.GA45201@blackbook> References: <20200623184515.4132564-1-guro@fb.com> <20200623184515.4132564-5-guro@fb.com> <20200729171039.GA22229@blackbody.suse.cz> <20200806211603.195727c03995c3a25ffc6d76@linux-foundation.org> <20200807043717.GA1231562@carbon.DHCP.thefacebook.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lrZ03NoBR/3+SXJZ" Content-Disposition: inline In-Reply-To: <20200807043717.GA1231562@carbon.DHCP.thefacebook.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 06, 2020 at 09:37:17PM -0700, Roman Gushchin wrot= e: > In general, yes. But in this case I think it wouldn't be a good idea: > most often cgroups are created by a centralized daemon (systemd), > which is usually located in the root cgroup. Even if it's located not in > the root cgroup, limiting it's memory will likely affect the whole system, > even if only one specific limit was reached. The generic scheme would be (assuming the no internal process constraint, in the root too) ` root or delegated root ` manager-cgroup (systemd, docker, ...) ` [aggregation group(s)] ` job-group-1 ` ... ` job-group-n > If there is a containerized workload, which creates sub-cgroups, > charging it's parent cgroup is perfectly effective. No dispute about this in either approaches. > And the opposite, if we'll charge the cgroup of a process, who created > a cgroup, we'll not cover the most common case: systemd creating > cgroups for all services in the system. What I mean is that systemd should be charged for the cgroup creation. Or more generally, any container/cgroup manager should be charged. Consider a leak when it wouldn't remove spent cgroups, IMO the effect (throttling, reclaim) should be exercised on such a culprit. I don't think the existing workload (job-group-i above) should unnecessarily suffer when only manager is acting up. Is that different =66rom your idea? > Right, but it's quite unusual for tasks from one cgroup to create sub-cgr= oups > in completely different cgroup. In this particular case there are tons of= other > ways how a task from C00 can hurt C1. I agree with that. If I haven't overlooked anything, this should be first case when cgroup-related structures are accounted (please correct me). So this is setting a precendent, if others show useful to be accounted in the future too. I'm thinking about cpu_cgroup_css_alloc() that can also allocate a lot (with big CPU count). The current approach would lead situations where matching cpu and memory csses needn't to exist and that would need special handling. > On Thu, Aug 06, 2020 at 09:16:03PM -0700, Andrew Morton wrote: > > These week-old issues appear to be significant. Roman? Or someone > > else? Despite my concerns, I don't think this is fundamental and can't be changed later so it doesn't prevent the inclusion in 5.9 RC1. Regards, Michal --lrZ03NoBR/3+SXJZ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEEoQaUCWq8F2Id1tNia1+riC5qSgFAl8yr5UACgkQia1+riC5 qSgqkg/+MCv3Rc5uG81ZfD7sWfTTfN12Pj2O+whAoYgOXvsv+JD1PsezvdVdwb3C oNH/HYMbJBNUkrz/9/pq53kJIIzq2UQ+cEbEatMy8T0kjImYn0Ark4JEF+R43egy gaYf26ABfNYxu+r+/aOPdnWx2yL9aeK3o0L9jyWxJhe6EqThSi+9eONCwA/j1fsZ /xhlhoojWC2hRVD18xG3xk3pIRCaYqYPq+NBNamnYiUcwrJ3/lE1VDawjWALSG+D 3PvxjphzJok0Ou+5Nxzh14jfYyXtPMkitHsq3+wA/nEjJWsbxY3AA9E8LG5gkMbe g5SG3N7clGWF+MqfHoGjIF6LUreF5mD+dDWGkovs9vWmA5WRAMZh9RhxFKD6QyXd 7437kkZxWWiut9AkWkp2iXqLjT1gY65lRHFIiELXIid71k0tVKNUe6Xy8OlVSOPv yFHC5EhDeWwwEI2FBCtlPP+7nwd0o5tZreYuyCyC1hroDWWiGa23z6u7Uin9pjON /qPGHkKid2E9EK6tS47cblvSXdpzO1Gc37hVZjrPsx2esdhumlQkZGJsgFh1kmRD v2Q8BZDTLnxdWzVFFpeHO4gToni/MbwHYYf98JjF8YLMtn2duZtecevAPUkAtpAM cxIITurK9Jwak8cIlPhtJaySEoHmWKI4MQrvgERh30m0Af3pqqY= =N0tJ -----END PGP SIGNATURE----- --lrZ03NoBR/3+SXJZ--