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 102AEC2D0A3 for ; Tue, 3 Nov 2020 21:27:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B07E32236F for ; Tue, 3 Nov 2020 21:27:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=fb.com header.i=@fb.com header.b="eVrWWoTq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B07E32236F 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 55AE76B0073; Tue, 3 Nov 2020 16:27:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 530FA6B0074; Tue, 3 Nov 2020 16:27:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 448D46B0075; Tue, 3 Nov 2020 16:27:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0076.hostedemail.com [216.40.44.76]) by kanga.kvack.org (Postfix) with ESMTP id 1A6C26B0073 for ; Tue, 3 Nov 2020 16:27:50 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id B501F181AC550 for ; Tue, 3 Nov 2020 21:27:49 +0000 (UTC) X-FDA: 77444394258.13.gun14_580304f272bb Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id 9656E18140B67 for ; Tue, 3 Nov 2020 21:27:49 +0000 (UTC) X-HE-Tag: gun14_580304f272bb X-Filterd-Recvd-Size: 7631 Received: from mx0b-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Tue, 3 Nov 2020 21:27:48 +0000 (UTC) Received: from pps.filterd (m0148460.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0A3LEXNN016772 for ; Tue, 3 Nov 2020 13:27:48 -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=lidgT5ochpdx7TzOuJz/Vh4Ll3+lsAsbNtZRKwN4A78=; b=eVrWWoTqYmGMxMWlw+Eypt0j0RjvlK06DNmqFAv1GpXMlT3gQ3AbT3S8r0d/1z2mw8JO AM/F/WmMCQZi/b5xEhuBfKh3I7+jUYtv1ybaMK3VZwaEl+0WbQX9yFAWNcNBPJrSXySk 8sDDy1t4tBXo3AJ7dsr23RZzGx4ZoEaEFe8= Received: from mail.thefacebook.com ([163.114.132.120]) by mx0a-00082601.pphosted.com with ESMTP id 34jexxja50-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 03 Nov 2020 13:27:48 -0800 Received: from intmgw004.06.prn3.facebook.com (2620:10d:c085:108::8) 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, 3 Nov 2020 13:27:29 -0800 Received: by devvm1755.vll0.facebook.com (Postfix, from userid 111017) id 628CA2026692; Tue, 3 Nov 2020 13:27:27 -0800 (PST) From: Roman Gushchin To: CC: Andrew Morton , Shakeel Butt , Johannes Weiner , Michal Hocko , Tejun Heo , , , Roman Gushchin Subject: [PATCH rfc 2/3] docs: cgroup-v1: reflect the deprecation of the non-hierarchical mode Date: Tue, 3 Nov 2020 13:27:24 -0800 Message-ID: <20201103212725.3716088-3-guro@fb.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20201103212725.3716088-1-guro@fb.com> References: <20201103212725.3716088-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-03_14:2020-11-03,2020-11-03 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 bulkscore=0 spamscore=0 suspectscore=1 mlxscore=0 impostorscore=0 mlxlogscore=999 phishscore=0 malwarescore=0 lowpriorityscore=0 adultscore=0 priorityscore=1501 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011030142 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 --- .../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