Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9943658imu; Sun, 30 Dec 2018 08:51:50 -0800 (PST) X-Google-Smtp-Source: ALg8bN59mEeByXDYP7s9x8GaTnNOQ4enr/yJlV3sv73xEu+for+aDvr20axxXbftteyxEaPGefGV X-Received: by 2002:a17:902:34a:: with SMTP id 68mr35155827pld.268.1546188709978; Sun, 30 Dec 2018 08:51:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546188709; cv=none; d=google.com; s=arc-20160816; b=cihB7h7kwg8i69ZNgL8QcvzbhSmDp4yQwiBosW6uUliiqhoUtB5Gh5xidG7VWz7u0u hlRCmjlqxt61JHruTuitkpILhCJHxFQceUXTd7pWsHd2hOpZaVmSWrZ7MB0bV9EG0I7a 3dcjrdT62JWe9R9UOGSkzKBOgzxTPSj1aF8Poi87GJZHYDlcTW5R8yPMalXElvvo3Zym yWXFak8ydv8V/T7Zb3mbZvJo1lS9ow13NCnW08NvdidEp4DXSql00BAWVk0p4aMV2H+7 jAtPh818ejOPOUwnPmE2nXVhIjHuxi+V0xDnyBSYuwtb3j9o+4D77kTEkFqX4c8fMi+I q1Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date; bh=7QNbNTeUOzAAsebsVxRjoALppGxxit6+JlTKpxjEShU=; b=DezeMJt2+KaxNudCpCjFbJtXFfOUx21QpkgBnyDTJ7fhhMNNL4l5QcEJOIyAP42LX6 6hz1/LfEwdbRY3p9ULsqrqWNvDpd1ph9bzlUXbx1MD+kUc93xPVuSDcnYXy7ygwAkj1E 4Ue3KqdEbROeAPFtnPbUuVgJRGVLjvk8CfxAJKGIqV3J4kfD/BisiP9ozrev52OqxnyQ Q2AnGfOS438LtOznQMs8Rrxg0LpQTVZY6u00kcmcG16JCxjKrisQ5GkQpYqKsFMVVeOE SxPfbF5aeJIQYuWqRy3p4hAQKADmrG3QWRL59XBcJDymI2F1VvWH0V7LN3vH6GRqf1go U0xA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p64si39938631pfg.79.2018.12.30.08.51.19; Sun, 30 Dec 2018 08:51:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726361AbeL3Qtz (ORCPT + 99 others); Sun, 30 Dec 2018 11:49:55 -0500 Received: from wes1-so2-b.wedos.net ([46.28.106.45]:33347 "EHLO wes1-so2.wedos.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725954AbeL3Qty (ORCPT ); Sun, 30 Dec 2018 11:49:54 -0500 Received: from localhost (ip4-46-39-182-135.cust.nbox.cz [46.39.182.135]) by wes1-so2.wedos.net (Postfix) with ESMTPSA id 43SRHy6XwVzpy; Sun, 30 Dec 2018 17:49:50 +0100 (CET) Date: Sun, 30 Dec 2018 17:49:45 +0100 From: Otto Sabart To: linux-doc@vger.kernel.org Cc: Tejun Heo , Jonathan Corbet , linux-kernel@vger.kernel.org Subject: [PATCH 1/2] doc: cgroup: use graphviz code instead of ASCII art Message-ID: <20181230164945.GA2644@personal> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="TB36FDmn/VVEgNH/" Content-Disposition: inline X-PGP-Key: http://seberm.com/pubkey.asc User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --TB36FDmn/VVEgNH/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable The graphviz looks better. This patch also fixes multiple build warnings: "WARNING: Block quote ends without a blank line; unexpected unindent." Signed-off-by: Otto Sabart --- Documentation/admin-guide/cgroup-v2.rst | 83 ++++++++++++++++++++----- 1 file changed, 66 insertions(+), 17 deletions(-) diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-= guide/cgroup-v2.rst index 7bf3f129c68b..80c88a0869e4 100644 --- a/Documentation/admin-guide/cgroup-v2.rst +++ b/Documentation/admin-guide/cgroup-v2.rst @@ -344,10 +344,21 @@ example, to start a clean-up operation after all proc= esses of a given sub-hierarchy have exited. The populated state updates and notifications are recursive. Consider the following sub-hierarchy where the numbers in the parentheses represent the numbers of processes -in each cgroup:: +in each cgroup: =20 - A(4) - B(0) - C(1) - \ D(0) +.. kernel-render:: DOT + :alt: hierarchy + + digraph subhierarchy { + edge [ + arrowhead=3D"none" + ]; + rankdir=3DLR; + + "A(4)" -> "B(0)"; + "B(0)" -> "C(1)"; + "B(0)" -> "D(0)"; + } =20 A, B and C's "populated" fields would be 1 while D's 0. After the one process in C exits, B and C's "populated" fields would flip to "0" and @@ -380,10 +391,21 @@ are specified, the last one is effective. Enabling a controller in a cgroup indicates that the distribution of the target resource across its immediate children will be controlled. Consider the following sub-hierarchy. The enabled controllers are -listed in parentheses:: +listed in parentheses: + +.. kernel-render:: DOT + :alt: hierarchy =20 - A(cpu,memory) - B(memory) - C() - \ D() + digraph subhierarchy { + edge [ + arrowhead=3D"none" + ]; + rankdir=3DLR; + + "A(cpu,memory)" -> "B(memory)"; + "B(memory)" -> "C()"; + "B(memory)" -> "D()"; + } =20 As A has "cpu" and "memory" enabled, A will control the distribution of CPU cycles and memory to its children, in this case, B. As B has @@ -497,12 +519,30 @@ in from or push out to outside the sub-hierarchy. =20 For an example, let's assume cgroups C0 and C1 have been delegated to user U0 who created C00, C01 under C0 and C10 under C1 as follows and -all processes under C0 and C1 belong to U0:: +all processes under C0 and C1 belong to U0: + +.. kernel-render:: DOT + :alt: cgroup hierarchy =20 - ~~~~~~~~~~~~~ - C0 - C00 - ~ cgroup ~ \ C01 - ~ hierarchy ~ - ~~~~~~~~~~~~~ - C1 - C10 + digraph hierarchyc0 { + edge [ + arrowhead=3D"none" + ]; + + "C0" -> "C00"; + "C0" -> "C01"; + } + +.. kernel-render:: DOT + :alt: cgroup hierarchy + + digraph hierarchyc1 { + edge [ + arrowhead=3D"none" + ]; + + "C1" -> "C10"; + } =20 Let's also say U0 wants to write the PID of a process which is currently in C10 into "C00/cgroup.procs". U0 has write access to the @@ -1505,12 +1545,21 @@ The limits are only applied at the peer level in th= e hierarchy. This means that in the diagram below, only groups A, B, and C will influence each other, a= nd groups D and F will influence each other. Group G will influence nobody. =20 - [root] - / | \ - A B C - / \ | - D F G - +.. kernel-render:: DOT + :alt: Peer hierarchy + + digraph hierarchy { + edge [ + arrowhead=3D"none" + ]; + + "[root]" -> "A"; + "[root]" -> "B"; + "[root]" -> "C"; + "A" -> "D"; + "A" -> "F"; + "B" -> "G"; + } =20 So the ideal way to configure this is to set io.latency in groups A, B, an= d C. Generally you do not want to set a value lower than the latency your device --=20 2.17.2 --TB36FDmn/VVEgNH/ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEb6VOpv2s03VHGoilgjuumfi+HjwFAlwo9ycACgkQgjuumfi+ HjzVOA/9Hjik0L0Nj3QOnVGTMvc9VVqbTYt8kEvoFwT2wuILkZY6dV0cOU9bkIfV YBfUV9uEBjWop43/ETdR9/xzUJbXgwsPMlQXcUxqcRTy/BWO4cZTIAh5b9+g7HNb SeZT38/FgFIMGNrmc6eAyoGHySYqLbMqDh05iYda2uZmKWKAkrMVvqJ7E6m6kVrw U9UEirwhYZAGF8w/EtIPgyM4ezKFBGEVuTDbI5QW795esPZ7meAOK1Fsv2hhHPUJ j6J4kV1r61fnNgbFyFfZD94yESaXcrOuRrrwuTk6VsassVtwyaTALp/rRhKMSJHo fjgqBNXwE3yqF+RDQBXd3a7EAi0ZwDRDB67bfoB28Eb4UEPzAJP2WQrKsJVG0pB2 l6ocnFo88gq6p8sCk9BWtycL/wyzAX3PLoQNOy0fkb+uQqpqJBVCgYM7mgV6QzKj E9hxJJ3uenX6qQGi7kM5PxTvpPO+uVDih3FV695UQhErImHGBMoJ5t/OOiPh0dpC H5xXq9ILtjxGrx3Jcv5suBlUnFkA0NaCsAxMQL7mAYcDHYKhViwDAL5L0TZ2bhIJ b9JWL6LWngCjabxHoaRy6HCugmCeyMVG+ijwZ55XIMpyuNrbizexzmQKeOwtJoXx RCBnRGbmjxEBSdGfYn8iTTRsRQahwXVWgoz4giYNVkJl5WJpPAk= =mFbc -----END PGP SIGNATURE----- --TB36FDmn/VVEgNH/--