From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A09DAC61DD8 for ; Tue, 10 Nov 2020 22:08:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 40A05207D3 for ; Tue, 10 Nov 2020 22:08:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=fb.com header.i=@fb.com header.b="XnqC1qp/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 40A05207D3 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=fb.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A41F26B0068; Tue, 10 Nov 2020 17:08:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9A3986B006E; Tue, 10 Nov 2020 17:08:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 77B986B0070; Tue, 10 Nov 2020 17:08:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0096.hostedemail.com [216.40.44.96]) by kanga.kvack.org (Postfix) with ESMTP id 4969E6B0068 for ; Tue, 10 Nov 2020 17:08:09 -0500 (EST) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id E1811362B for ; Tue, 10 Nov 2020 22:08:08 +0000 (UTC) X-FDA: 77469897456.20.wing10_32169c2272f8 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id B2E6B180C07AB for ; Tue, 10 Nov 2020 22:08:08 +0000 (UTC) X-HE-Tag: wing10_32169c2272f8 X-Filterd-Recvd-Size: 7792 Received: from mx0b-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Tue, 10 Nov 2020 22:08:07 +0000 (UTC) Received: from pps.filterd (m0109331.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0AAM4i81012705 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 34r2au8buu-9 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 10 Nov 2020 14:08:06 -0800 Received: from intmgw002.41.prn1.facebook.com (2620:10d:c085:108::8) by mail.thefacebook.com (2620:10d:c085:11d::7) 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 spamscore=0 bulkscore=0 malwarescore=0 phishscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 suspectscore=0 priorityscore=1501 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011100150 X-FB-Internal: deliver X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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