From patchwork Mon Dec 19 04:22:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bagas Sanjaya X-Patchwork-Id: 13076241 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA5A9C4332F for ; Mon, 19 Dec 2022 04:22:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B83DD8E000C; Sun, 18 Dec 2022 23:22:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AC6ED8E0005; Sun, 18 Dec 2022 23:22:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 824EE940007; Sun, 18 Dec 2022 23:22:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 6B578900003 for ; Sun, 18 Dec 2022 23:22:28 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 53E1B1C3D46 for ; Mon, 19 Dec 2022 04:22:28 +0000 (UTC) X-FDA: 80257759176.06.CD68859 Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by imf26.hostedemail.com (Postfix) with ESMTP id 90D75140006 for ; Mon, 19 Dec 2022 04:22:26 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=mRDBpTfs; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf26.hostedemail.com: domain of bagasdotme@gmail.com designates 209.85.216.43 as permitted sender) smtp.mailfrom=bagasdotme@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1671423746; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=m1lEXUxDv+RQRfIU+EhWl1xsmh7T8TN0B09r+Rt+f6E=; b=npbKSTr9N6vhStGSSDlDKxnjQervCQP4pVNvndKh3df0pM8k4V/mODPewRP0yWq5DhT8Gn lWfqLhBPy/1goBQK+oWLvUhvG3Q0qbtztCGuXGM1fO43i2zXYV7SzK/iM4fjCg0BXEU6dD WRj06LFwOF9yyK197453R4uiS4MH4RI= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=mRDBpTfs; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf26.hostedemail.com: domain of bagasdotme@gmail.com designates 209.85.216.43 as permitted sender) smtp.mailfrom=bagasdotme@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1671423746; a=rsa-sha256; cv=none; b=WPi8K53U12/RGxvNkXmCvhIYHEHX5uHO4X5md1zotThSM5cXGJmrMEsa6ttCMk3ei41Cf3 FyQxE3dwcOt6qFqa9i/2XIc6Wg2KPLDSiRXkUCXmgffUR/sCNL21OfeK7tAZrsTIKvjB5S JhvCBQML5jqlA3jj2Ni+PrBmm76encg= Received: by mail-pj1-f43.google.com with SMTP id e7-20020a17090a77c700b00216928a3917so11723756pjs.4 for ; Sun, 18 Dec 2022 20:22:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=m1lEXUxDv+RQRfIU+EhWl1xsmh7T8TN0B09r+Rt+f6E=; b=mRDBpTfsKGJFj9sStOs+u6rafPXo1yrNY3co/JxzhxWdSf+Ee9lJP+AcKfTLxqHGJ7 /ruFXJ54tEJ4/+rcvJpAXQGBvu8w2UNqb0qeXxzf0gv8Jkp/oTNCrG9/na5e2adVEq5C WuJOTPR+DvmUilQKp2CDo8N0Cc5zHA/oHv8XtyTh95Op/bEJ3NuqFA7gFCBB7/YTl1bk h8H9Tdq13+dru7pjLYX0hoC91Z+4PFfcpUS8bKiUP/j1BA+kOvIF7kF1ElNq7ehaveTa 5BiBrlFzSwLanGEXndk8Nv7qoHt5phcg46YAkWLGp+UfoZmPVmgbEzGUnf4RnmEo06ab 3+2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=m1lEXUxDv+RQRfIU+EhWl1xsmh7T8TN0B09r+Rt+f6E=; b=T60PSfr9oVMOUmEZj88p0CwvYuLHf7/vF4iGHnR7DkR8TKuvroJijAplZYypJEJS4O lgBODNEJFrJgL5/8l8Sp/DWY2Lzbwc8upE05fSfEmWSW1l112YVqlySGU4qUBlZ+o3hQ EM9GC1OJsL7WU1ru9VuAyTWjb7F0pBQ1bEWWK+jejSEprLuWHLx78z3eOGb+MQaSw3a1 zEWpzuR//cjvllh7Q3z5/C72zRKqQX2mTauPi++N5H5lVx99h8RWGBQkYvS7K9AKXfkf tCk8Z5HAiAnmd8ONsqHe2mAXSOhvWeUPNxhCBVf5BqHESTX33TnjdDl9y4GOvKZHaoka OEPw== X-Gm-Message-State: AFqh2kqJoHojsZHGS/5x33piPlX2ntzQ+QqgSFG+kc8C5iNbi9SzxIwp KDFgmZmNd/O6Rhb1UctCwBc= X-Google-Smtp-Source: AMrXdXuHTIuf1k1NZ+BSaH+fLP88vjx6aUE1R2UTN8o/LCwMK8JQI/oHDBZOqtPYKI0Wdfg3I4Phqw== X-Received: by 2002:a17:90a:b384:b0:213:b6c8:2295 with SMTP id e4-20020a17090ab38400b00213b6c82295mr7583508pjr.22.1671423745509; Sun, 18 Dec 2022 20:22:25 -0800 (PST) Received: from debian.me (subs32-116-206-28-20.three.co.id. [116.206.28.20]) by smtp.gmail.com with ESMTPSA id b13-20020a17090a5a0d00b0021806f631ccsm4817086pjd.30.2022.12.18.20.22.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Dec 2022 20:22:23 -0800 (PST) Received: by debian.me (Postfix, from userid 1000) id 87729104054; Mon, 19 Dec 2022 11:22:14 +0700 (WIB) From: Bagas Sanjaya To: cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Linux Memory Management List Cc: Tejun Heo , Zefan Li , Johannes Weiner , Jonathan Corbet , Michal Hocko , Andrew Morton , Hugh Dickins , Shakeel Butt , Bagas Sanjaya Subject: [PATCH 09/10] docs: cgroup-v1: add internal cross-references Date: Mon, 19 Dec 2022 11:22:08 +0700 Message-Id: <20221219042209.22898-10-bagasdotme@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221219042209.22898-1-bagasdotme@gmail.com> References: <20221219042209.22898-1-bagasdotme@gmail.com> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=5927; i=bagasdotme@gmail.com; h=from:subject; bh=9S/rkKjh7S+VIO4A14dIVvNcepKziJ1wiMcg1+yyND0=; b=owGbwMvMwCX2bWenZ2ig32LG02pJDMnzn33w62KZ2zBTurxBrqKy41HuS1ff56zOJzwbQ/9xeLTv dD3XUcrCIMbFICumyDIpka/p9C4jkQvtax1h5rAygQxh4OIUgIlYGTEyvOj691Dsls78a7/0WFe6uD IcOLpg2rH2CUdm9buXrS6X6WFk6Jj/+OPi+BmnM//9uHV+710Pl3/vj6/KOTgzaOJd5+dMz1gA X-Developer-Key: i=bagasdotme@gmail.com; a=openpgp; fpr=701B806FDCA5D3A58FFB8F7D7C276C64A5E44A1D X-Rspamd-Queue-Id: 90D75140006 X-Rspamd-Server: rspam09 X-Rspam-User: X-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NKc4F4mPxURmwBa8aJCgsriFTKnVi1c7TD98kaXAOkosk4Fuhee77RjSRZKwJ0Admp+5TBmy7hSSaEGqX1UkulAtUSLFSNFwNaVmdVq+74lssKK0gG 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: The documentation contains references to other sections in the doc (internal). Add cross-references for them so that these can be accessed without having to manually search for them. Signed-off-by: Bagas Sanjaya --- .../admin-guide/cgroup-v1/memory.rst | 43 +++++++++++++------ 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/Documentation/admin-guide/cgroup-v1/memory.rst b/Documentation/admin-guide/cgroup-v1/memory.rst index 863e0f17ca0067..ae3a1d3873d73b 100644 --- a/Documentation/admin-guide/cgroup-v1/memory.rst +++ b/Documentation/admin-guide/cgroup-v1/memory.rst @@ -55,7 +55,8 @@ Features: - Root cgroup has no limit controls. Kernel memory support is a work in progress, and the current version provides - basically functionality. (See Section 2.7) + basically functionality. (See :ref:`section 2.7 + `) Brief summary of control files. @@ -223,8 +224,9 @@ behind this approach is that a cgroup that aggressively uses a shared page will eventually get charged for it (once it is uncharged from the cgroup that brought it in -- this will happen on memory pressure). -But see section 8.2: when moving a task to another cgroup, its pages may -be recharged to the new cgroup, if move_charge_at_immigrate has been chosen. +But see :ref:`section 8.2 ` when moving a +task to another cgroup, its pages may be recharged to the new cgroup, if +move_charge_at_immigrate has been chosen. 2.4 Swap Extension -------------------------------------- @@ -272,7 +274,7 @@ global VM. When a cgroup goes over its limit, we first try to reclaim memory from the cgroup so as to make space for the new pages that the cgroup has touched. If the reclaim is unsuccessful, an OOM routine is invoked to select and kill the bulkiest task in the -cgroup. (See 10. OOM Control below.) +cgroup. (See :ref:`10. OOM Control ` below.) The reclaim algorithm has not been modified for cgroups, except that pages that are selected for reclaiming come from the per-cgroup LRU @@ -286,7 +288,7 @@ list. When panic_on_oom is set to "2", the whole system will panic. When oom event notifier is registered, event will be delivered. -(See oom_control section) +(See :ref:`oom_control ` section) 2.6 Locking ----------- @@ -303,6 +305,8 @@ Per-node-per-memcgroup LRU (cgroup's private LRU) is guarded by lruvec->lru_lock; PG_lru bit of page->flags is cleared before isolating a page from its LRU under lruvec->lru_lock. +.. _cgroup-v1-memory-kernel-extension: + 2.7 Kernel Memory Extension ----------------------------------------------- @@ -462,6 +466,8 @@ test because it has noise of shared objects/status. But the above two are testing extreme situations. Trying usual test under memory controller is always helpful. +.. _cgroup-v1-memory-test-troubleshoot: + 4.1 Troubleshooting ------------------- @@ -474,8 +480,11 @@ terminated by the OOM killer. There are several causes for this: A sync followed by echo 1 > /proc/sys/vm/drop_caches will help get rid of some of the pages cached in the cgroup (page cache pages). -To know what happens, disabling OOM_Kill as per "10. OOM Control" (below) and -seeing what happens will be helpful. +To know what happens, disabling OOM_Kill as per :ref:`"10. OOM Control" +` (below) and seeing what happens will be +helpful. + +.. _cgroup-v1-memory-test-task-migration: 4.2 Task migration ------------------ @@ -486,15 +495,16 @@ remain charged to it, the charge is dropped when the page is freed or reclaimed. You can move charges of a task along with task migration. -See 8. "Move charges at task migration" +See :ref:`8. "Move charges at task migration" ` 4.3 Removing a cgroup --------------------- -A cgroup can be removed by rmdir, but as discussed in sections 4.1 and 4.2, a -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.) +A cgroup can be removed by rmdir, but as discussed in :ref:`sections 4.1 +` and :ref:`4.2 +`, a 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 parent, and no change on the charge except uncharging from the child. @@ -721,6 +731,8 @@ If we want to change this to 1G, we can at any time use:: It is recommended to set the soft limit always below the hard limit, otherwise the hard limit will take precedence. +.. _cgroup-v1-memory-move-charges: + 8. Move charges at task migration (DEPRECATED!) =============================================== @@ -750,7 +762,8 @@ If you want to enable it:: .. note:: Each bits of move_charge_at_immigrate has its own meaning about what type - of charges should be moved. See 8.2 for details. + of charges should be moved. See :ref:`section 8.2 + ` for details. .. note:: Charges are moved only when you move mm->owner, in other words, @@ -768,6 +781,8 @@ And if you want disable it again:: # echo 0 > memory.move_charge_at_immigrate +.. _cgroup-v1-memory-movable-charges: + 8.2 Type of charges which can be moved -------------------------------------- @@ -817,6 +832,8 @@ threshold in any direction. It's applicable for root and non-root cgroup. +.. _cgroup-v1-memory-oom-control: + 10. OOM Control ===============