Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1140453pxb; Wed, 4 Nov 2020 00:42:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJzbg6Ea+Sh05gFT7UeWvDcV+uy8Aa0rIEFXPTS53X8ZUahkMGOIl0+vlp2VZc5cFK+gSO+G X-Received: by 2002:aa7:dc52:: with SMTP id g18mr26279836edu.369.1604479331140; Wed, 04 Nov 2020 00:42:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604479331; cv=none; d=google.com; s=arc-20160816; b=CJom0vnNhsmHkRH2cC4VwXFgdk7yfe7Pmje2z47hlQ9EAMreupTqYldkY41wtlg62I o4NZh3oHkP71q5TZAaTSE5S2/uN91eA21DDRV+1ip3vDnmXlT8kFXD3yqFV4e4NRtHT6 NtBBU4ueIRy3pCuitxGlF0DuWkwhLoM2BV5urcKKvluJR9yn+FbtDuFQvBsdqaSno2/b laaJRBM6TFjF785tr3m8pZxHxLTq3bIwTaIukSOf8yWd1Ww3NRRZgX4jc49Ke8fYvEjY 5iusIbXIbHHEg9VzComvlVw1J4vJLQGGnzMlIM0dqJp9IEBGBUFqVOzaBDut9UDIecJg lFKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=syUOeZVis/mCwu8fd3UHVg+xOCzGMKG+bwd8HAGySfQ=; b=g1aMakZ10jNfjdraI/Zwi3tqEBaNWw5bgy0fmHi1QBLfOlUTrxb65/aPhg5Q9++eFY um1a25Gg0vj0MaYYEll/1FsxqF9IKvuR0gYApWYFt2eZhwo7RmS35DQZb0JrARC0NcOs 6leW73mdjbyzmwFsypo9w6/klsj6ZC/4iDerSmf3gzufFYYRn5X3rop9Aa3q1sUkPYdd /AFhIhFmjTxVRb75Y8/9RowkQ1ZYvHctXj8ZTIz6EDRjcEogTvklXRFIbes7803/G69H wKyWljderIXCLxvoDWAJF7j0o8uGcVLfYZ9crah7FYOpS/dZt9xAnLlY561Gfy+RJOgA NQhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=m0Cd64um; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cd24si968254ejb.213.2020.11.04.00.41.48; Wed, 04 Nov 2020 00:42:11 -0800 (PST) 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=@suse.com header.s=susede1 header.b=m0Cd64um; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728066AbgKDIj4 (ORCPT + 99 others); Wed, 4 Nov 2020 03:39:56 -0500 Received: from mx2.suse.de ([195.135.220.15]:36704 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725891AbgKDIj4 (ORCPT ); Wed, 4 Nov 2020 03:39:56 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1604479194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=syUOeZVis/mCwu8fd3UHVg+xOCzGMKG+bwd8HAGySfQ=; b=m0Cd64umG8ekm2e4xzXb1VdFG7hZa8TCyBpftGpns6wGN0PMRrsJ0NBX4AmlpaVZLIv3OH NLIWU7sciCIMKrmJWSv+rlmbktjWLPEYtEkk6UYrfeOIuk2qNdziQdGRnGZBx/bzp48hD+ EYx+lARTS7an1MOFV//1Hfuy5GjM76g= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id AAEA3AC2E; Wed, 4 Nov 2020 08:39:54 +0000 (UTC) Date: Wed, 4 Nov 2020 09:39:53 +0100 From: Michal Hocko To: Roman Gushchin Cc: linux-mm@kvack.org, Andrew Morton , Shakeel Butt , Johannes Weiner , Tejun Heo , linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH rfc 2/3] docs: cgroup-v1: reflect the deprecation of the non-hierarchical mode Message-ID: <20201104083953.GD10052@dhcp22.suse.cz> References: <20201103212725.3716088-1-guro@fb.com> <20201103212725.3716088-3-guro@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201103212725.3716088-3-guro@fb.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 03-11-20 13:27:24, Roman Gushchin wrote: > Update cgroup v1 docs after the deprecation of the non-hierarchical > mode of the memory controller. > > Signed-off-by: Roman Gushchin Acked-by: Michal Hocko > --- > .../admin-guide/cgroup-v1/memcg_test.rst | 8 ++-- > .../admin-guide/cgroup-v1/memory.rst | 40 ++++++------------- > 2 files changed, 16 insertions(+), 32 deletions(-) > > diff --git a/Documentation/admin-guide/cgroup-v1/memcg_test.rst b/Documentation/admin-guide/cgroup-v1/memcg_test.rst > index 3f7115e07b5d..4f83de2dab6e 100644 > --- a/Documentation/admin-guide/cgroup-v1/memcg_test.rst > +++ b/Documentation/admin-guide/cgroup-v1/memcg_test.rst > @@ -219,13 +219,11 @@ Under below explanation, we assume CONFIG_MEM_RES_CTRL_SWAP=y. > > This is an easy way to test page migration, too. > > -9.5 mkdir/rmdir > ---------------- > +9.5 nested cgroups > +------------------ > > - When using hierarchy, mkdir/rmdir test should be done. > - Use tests like the following:: > + Use tests like the following for testing nested cgroups:: > > - echo 1 >/opt/cgroup/01/memory/use_hierarchy > mkdir /opt/cgroup/01/child_a > mkdir /opt/cgroup/01/child_b > > diff --git a/Documentation/admin-guide/cgroup-v1/memory.rst b/Documentation/admin-guide/cgroup-v1/memory.rst > index 12757e63b26c..a44cd467d218 100644 > --- a/Documentation/admin-guide/cgroup-v1/memory.rst > +++ b/Documentation/admin-guide/cgroup-v1/memory.rst > @@ -77,6 +77,8 @@ Brief summary of control files. > memory.soft_limit_in_bytes set/show soft limit of memory usage > memory.stat show various statistics > memory.use_hierarchy set/show hierarchical account enabled > + This knob is deprecated and shouldn't be > + used. > memory.force_empty trigger forced page reclaim > memory.pressure_level set memory pressure notifications > memory.swappiness set/show swappiness parameter of vmscan > @@ -495,16 +497,13 @@ cgroup might have some charge associated with it, even though all > tasks have migrated away from it. (because we charge against pages, not > against tasks.) > > -We move the stats to root (if use_hierarchy==0) or parent (if > -use_hierarchy==1), and no change on the charge except uncharging > +We move the stats to parent, and no change on the charge except uncharging > from the child. > > Charges recorded in swap information is not updated at removal of cgroup. > Recorded information is discarded and a cgroup which uses swap (swapcache) > will be charged as a new owner of it. > > -About use_hierarchy, see Section 6. > - > 5. Misc. interfaces > =================== > > @@ -527,8 +526,6 @@ About use_hierarchy, see Section 6. > write will still return success. In this case, it is expected that > memory.kmem.usage_in_bytes == memory.usage_in_bytes. > > - About use_hierarchy, see Section 6. > - > 5.2 stat file > ------------- > > @@ -675,31 +672,20 @@ hierarchy:: > d e > > In the diagram above, with hierarchical accounting enabled, all memory > -usage of e, is accounted to its ancestors up until the root (i.e, c and root), > -that has memory.use_hierarchy enabled. If one of the ancestors goes over its > -limit, the reclaim algorithm reclaims from the tasks in the ancestor and the > -children of the ancestor. > - > -6.1 Enabling hierarchical accounting and reclaim > ------------------------------------------------- > - > -A memory cgroup by default disables the hierarchy feature. Support > -can be enabled by writing 1 to memory.use_hierarchy file of the root cgroup:: > +usage of e, is accounted to its ancestors up until the root (i.e, c and root). > +If one of the ancestors goes over its limit, the reclaim algorithm reclaims > +from the tasks in the ancestor and the children of the ancestor. > > - # echo 1 > memory.use_hierarchy > - > -The feature can be disabled by:: > +6.1 Hierarchical accounting and reclaim > +--------------------------------------- > > - # echo 0 > memory.use_hierarchy > +Hierarchical accounting is enabled by default. Disabling the hierarchical > +accounting is deprecated. An attempt to do it will result in a failure > +and a warning printed to dmesg. > > -NOTE1: > - Enabling/disabling will fail if either the cgroup already has other > - cgroups created below it, or if the parent cgroup has use_hierarchy > - enabled. > +For compatibility reasons writing 1 to memory.use_hierarchy will always pass:: > > -NOTE2: > - When panic_on_oom is set to "2", the whole system will panic in > - case of an OOM event in any cgroup. > + # echo 1 > memory.use_hierarchy > > 7. Soft limits > ============== > -- > 2.26.2 -- Michal Hocko SUSE Labs