Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4345995pxb; Tue, 10 Nov 2020 14:11:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwXcEN/W+dGbTnpIV2/ICuhSu3Gf0lr0Rm9wcj+wgUL+hzt5uBlMkg50GKUrtzOsXmsiyrH X-Received: by 2002:a05:6402:1750:: with SMTP id v16mr1602799edx.241.1605046270017; Tue, 10 Nov 2020 14:11:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605046270; cv=none; d=google.com; s=arc-20160816; b=DhK6fcS6ESVIvLPIntMEWJViU6qnH18JvHuFKj2ixZY7bAR9t38vTFVm2xY/LiZ20z nd9u6p6AQAoRvxV5ODcyFy/VzxmFDXnzcw7yCRSlx77+aId3aKl62wSlH2rncl1GY9xx 01RFCtmn77E2ywtNBQ2c/c+rUPgRcSiHLQ1e7RaEs/9LfnAwi7ZcfL+4W1N1tiiplSvf wSnaBPgR7ZO25T/xCRK/fj7qvtCf2rjvK/Ui3fgvwxJolygNxuNDMl70EjM9B6OmLjFY +1MHF/ghVsl8RdfSTVRkb+xVps6QxdC0E/h6uFOZqrVOFa1SG4JxyWC+6IPyDqa05fRw LIzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3rEvTXwXGygIkUG9VhVhzqdHFFnaHJcGr6M+z46dO3c=; b=jLbZBrjV3NnWf0vc2ezdP9oG6TuQaMTUTDrdGoaZ+GvKlPwe+rZnNZQbqB1592dHCE vIX60ZK8cSNbODnzXXcgmziRhqbuWfNT+mfCWIk0If0H5jI8K4bx3arGgY91uup+NfaP iGBcYyNMNBqCfHXLJ2ecGAj7NOINe8smxgTSozBiz4egOr9VxYZm5AFbtnxKE9/z03Wr jleRvulc8N7FtKLipj6vJrZek40bZ89C9HxI4vBrF55JUU+WfvP4lwnuxkvGTeJSPyOg o8N0V2neTDzAU8MyMmSBSfqD8GHq9Juuv5g5PnkbqQAM8DH+U1AOFTpOR1nP1xvn9Hc5 vHTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b="XnqC1qp/"; 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=REJECT sp=REJECT dis=NONE) header.from=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x37si47013ede.385.2020.11.10.14.10.46; Tue, 10 Nov 2020 14:11:10 -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=@fb.com header.s=facebook header.b="XnqC1qp/"; 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=REJECT sp=REJECT dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732071AbgKJWII (ORCPT + 99 others); Tue, 10 Nov 2020 17:08:08 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:45322 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726706AbgKJWIH (ORCPT ); Tue, 10 Nov 2020 17:08:07 -0500 Received: from pps.filterd (m0109332.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0AAM50gJ009287 for ; Tue, 10 Nov 2020 14:08:06 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=facebook; bh=3rEvTXwXGygIkUG9VhVhzqdHFFnaHJcGr6M+z46dO3c=; b=XnqC1qp/brZ1ov/fR5B30bwCWzq1eWQnpldStckk9zHzWE7uQQndI15Up+rna1YWJAJA 0zHu3FD20bqL9GbZrdMVBdLaUBmYwOs3Wnyc/5DrUEoDu7QCYhTDnfkcZ93TngmPS7xR ng1KJHTpOPlgiSHZjXPLuDtWW7dwAgsfqug= Received: from mail.thefacebook.com ([163.114.132.120]) by mx0a-00082601.pphosted.com with ESMTP id 34pcmjdaju-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 10 Nov 2020 14:08:05 -0800 Received: from intmgw002.41.prn1.facebook.com (2620:10d:c085:208::f) by mail.thefacebook.com (2620:10d:c085:11d::4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Tue, 10 Nov 2020 14:08:04 -0800 Received: by devvm1755.vll0.facebook.com (Postfix, from userid 111017) id 32044239AED5; Tue, 10 Nov 2020 14:08:01 -0800 (PST) From: Roman Gushchin To: Andrew Morton , CC: Shakeel Butt , Johannes Weiner , Michal Hocko , , David Rientjes , , Roman Gushchin , Michal Hocko Subject: [PATCH v1 2/3] docs: cgroup-v1: reflect the deprecation of the non-hierarchical mode Date: Tue, 10 Nov 2020 14:07:59 -0800 Message-ID: <20201110220800.929549-3-guro@fb.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20201110220800.929549-1-guro@fb.com> References: <20201110220800.929549-1-guro@fb.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-FB-Internal: Safe Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312,18.0.737 definitions=2020-11-10_08:2020-11-10,2020-11-10 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 bulkscore=0 lowpriorityscore=0 adultscore=0 impostorscore=0 spamscore=0 priorityscore=1501 mlxscore=0 suspectscore=0 clxscore=1015 phishscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011100150 X-FB-Internal: deliver Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Update cgroup v1 docs after the deprecation of the non-hierarchical mode of the memory controller. Signed-off-by: Roman Gushchin Reviewed-by: Shakeel Butt Acked-by: Michal Hocko Acked-by: David Rientjes --- .../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/Documen= tation/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_C= TRL_SWAP=3Dy. =20 This is an easy way to test page migration, too. =20 -9.5 mkdir/rmdir ---------------- +9.5 nested cgroups +------------------ =20 - When using hierarchy, mkdir/rmdir test should be done. - Use tests like the following:: + Use tests like the following for testing nested cgroups:: =20 - echo 1 >/opt/cgroup/01/memory/use_hierarchy mkdir /opt/cgroup/01/child_a mkdir /opt/cgroup/01/child_b =20 diff --git a/Documentation/admin-guide/cgroup-v1/memory.rst b/Documentati= on/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, e= ven though all tasks have migrated away from it. (because we charge against pages, not against tasks.) =20 -We move the stats to root (if use_hierarchy=3D=3D0) or parent (if -use_hierarchy=3D=3D1), and no change on the charge except uncharging +We move the stats to parent, and no change on the charge except unchargi= ng from the child. =20 Charges recorded in swap information is not updated at removal of cgroup= . Recorded information is discarded and a cgroup which uses swap (swapcach= e) will be charged as a new owner of it. =20 -About use_hierarchy, see Section 6. - 5. Misc. interfaces =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 @@ -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 =3D=3D memory.usage_in_bytes. =20 - About use_hierarchy, see Section 6. - 5.2 stat file ------------- =20 @@ -675,31 +672,20 @@ hierarchy:: d e =20 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 cgr= oup:: +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 recla= ims +from the tasks in the ancestor and the children of the ancestor. =20 - # echo 1 > memory.use_hierarchy - -The feature can be disabled by:: +6.1 Hierarchical accounting and reclaim +--------------------------------------- =20 - # echo 0 > memory.use_hierarchy +Hierarchical accounting is enabled by default. Disabling the hierarchica= l +accounting is deprecated. An attempt to do it will result in a failure +and a warning printed to dmesg. =20 -NOTE1: - Enabling/disabling will fail if either the cgroup already has oth= er - cgroups created below it, or if the parent cgroup has use_hierarc= hy - enabled. +For compatibility reasons writing 1 to memory.use_hierarchy will always = pass:: =20 -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 =20 7. Soft limits =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --=20 2.26.2