From patchwork Mon Dec 19 04:22:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bagas Sanjaya X-Patchwork-Id: 13076237 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 0F6B0C4167B for ; Mon, 19 Dec 2022 04:22:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ABF078E000A; Sun, 18 Dec 2022 23:22:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A21DE8E0005; Sun, 18 Dec 2022 23:22:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 824308E000B; Sun, 18 Dec 2022 23:22:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 659AF8E000A for ; Sun, 18 Dec 2022 23:22:26 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 2EA72A0A88 for ; Mon, 19 Dec 2022 04:22:26 +0000 (UTC) X-FDA: 80257759092.15.1040712 Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by imf06.hostedemail.com (Postfix) with ESMTP id 6281A180003 for ; Mon, 19 Dec 2022 04:22:24 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=U8mV2UMq; spf=pass (imf06.hostedemail.com: domain of bagasdotme@gmail.com designates 209.85.216.48 as permitted sender) smtp.mailfrom=bagasdotme@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1671423744; 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=szBp/K72BE8/BicOSwRE0ZIF4ays06I72BistI/53Pk=; b=MKeQtfBQjsfl6m/u1AHYJQi4zK4KyGcUI5yEitxzGaqAk5x7PR7nde+iY9pYvcuXcMcsSS PqeIClbQJc3C43GeGsnYt56klrQTMCUC6UEGPA/CyIbNkNOa9nIyvbQhyJzmirYrLSpLdO 6pqO4clGacc/PYDbnBWNhsfD4duzEdk= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=U8mV2UMq; spf=pass (imf06.hostedemail.com: domain of bagasdotme@gmail.com designates 209.85.216.48 as permitted sender) smtp.mailfrom=bagasdotme@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1671423744; a=rsa-sha256; cv=none; b=r35V/BKsWUWFbV/M9NQVq4sU3spVIaURyHaa+wzdyrelHXGPFrCIKuoBu6k8VVAzAxw20X juDUCtT0CF75RdPEbe8r9nWG0vcUS9aZOtyzS6XIVYEDExAI0M0iMBEFsbcO4McvRd9pTy nRy23rt1sMrkvV7RkGMr/q6VM5/vs/A= Received: by mail-pj1-f48.google.com with SMTP id fa4-20020a17090af0c400b002198d1328a0so13200656pjb.0 for ; Sun, 18 Dec 2022 20:22:24 -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=szBp/K72BE8/BicOSwRE0ZIF4ays06I72BistI/53Pk=; b=U8mV2UMqqjrK76pglD8zq0C3ETUIxiTKnqdujwOR1qcvaxNfhqdcHidmBUWAcceOzr y+Suw92hyd+cGnMxdplh2Zbh/USuOlHnACokA+9qPliCRmT3CwZK1r7vEHS4fS/8lpwW rrUnQpmiPj2h/meLZp8vgu8PHs0S3QalFVHJh1AJRCji5YGu1wpEjCICHGPLZvnmIJnM jDBTxQVTtcluZTysxPluqLoFbhmLlIxw5zWp9dHVlhkRyLhCW5xG9LptVj7zoxUOqE5d dzytGhmBIrO+zIgiFqlSKYE3HSILCOMh7bDi1pEmu/rC1qR83Lu5voDaYXHisXoGJ15K JMtA== 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=szBp/K72BE8/BicOSwRE0ZIF4ays06I72BistI/53Pk=; b=t8TBmKXo+wPyE9YA+Aqczt7K6V32tKgHEfKslGK+vVdMKvR3+Ho09srnqfg3P5w1qR xQ1ERwFhE+kqhRajNxZedneIOTIWrNbA4SnAPCTtny74GsaH4kifUmZ8vUs5axVsj4YZ DwEk2vtNXYxFQ1tMv+KFeQD07orptcL6HxrbVfnhUsFDMQlkFyX9PKsCpAOAF+j0C5Cx vLriZUvzeMAlJ+xF338G90JYLHZc5q/GoYYL1MKYz8Yesv7iGha6BPs/jSihI7ZRqdku RC3wuAnuZRRztMTNkawz3Ya7/qFSpTfb2Zq1P/R/p6JhoDpz31SkUXXy/dKWzeKHOVaS bLvA== X-Gm-Message-State: AFqh2krax1gof45+1xZ3BLYny7JBVhve2eaEez5pCc3zse+usZjM48uG NDyTU2nMRNQTsH9sdCscmnqSLtnHpZE= X-Google-Smtp-Source: AMrXdXsaWnf+YsPfG0kbNpKSn0wN8/z9T5tw2wVXv1UitQlm7avF6zIUjxIy0Ns5NvJMeue6JNod5Q== X-Received: by 2002:a05:6a20:8f01:b0:af:e891:f4cb with SMTP id b1-20020a056a208f0100b000afe891f4cbmr15555056pzk.27.1671423743336; Sun, 18 Dec 2022 20:22:23 -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 a3-20020aa794a3000000b005750d6b4761sm5349770pfl.168.2022.12.18.20.22.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Dec 2022 20:22:22 -0800 (PST) Received: by debian.me (Postfix, from userid 1000) id 0136F103F5F; Mon, 19 Dec 2022 11:22:13 +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 02/10] docs: cgroup-v1: replace custom note constructs with appropriate admonition blocks Date: Mon, 19 Dec 2022 11:22:01 +0700 Message-Id: <20221219042209.22898-3-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=5301; i=bagasdotme@gmail.com; h=from:subject; bh=9M2vbQHkCDEOiNLeCwV/da0jjZmiwfDhmvzgespqc+I=; b=owGbwMvMwCX2bWenZ2ig32LG02pJDMnzn727o/DpacD63LWPLCMXrVpgbzrTSVndwerLZ8EPS6Lv /NTO7ChlYRDjYpAVU2SZlMjXdHqXkciF9rWOMHNYmUCGMHBxCsBEHlxg+O/IYedZt37L7my1VOdDb8 21Go2P8c1/+5VdziZaPcWJ+yojw60tUjpXliw1T/4m5S1/XfZ4gcXjkL/NL7cphRcGcJ1mYgAA X-Developer-Key: i=bagasdotme@gmail.com; a=openpgp; fpr=701B806FDCA5D3A58FFB8F7D7C276C64A5E44A1D X-Rspamd-Queue-Id: 6281A180003 X-Stat-Signature: wtc9ins4kdpe4ry5bxgh7zd93fapx3mw X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1671423744-867307 X-HE-Meta: U2FsdGVkX19NrvygFWXdBP2JQEulu1jKbV+72tA3JVyEuGisgW6vnlV2bkDluPLWjfJEQ259QJWxOx9l0MEhVnc6jzvrH/HlYom3n9cjQusOnS9f2LlwUkfly5s1FYKKPxbFS/oxhykycp2ScjkbsRLTcgPzNX395IT381FDZaL5dyB1hmrx+I8oPLmo1j4655u4TskF1Kh8/m/JMyGRXkvg50Xi5beJtEva3BLGufAfJNLHt845uB+j/qYPb3rdfLRPaEN0fEyXOTDI7B4tAh+YUz7XmU7ZkklzJjKxrnUAuVs4lRsEHki1DGYks17h87xd5dMdykHS3yU3ACJs+0rmMltU5nCG0OXzq7H63El39c3C17oOtbbq0G+1TX/uF//UPb2iTLdjz4M48vEUeL0aXBi84g01ALSVCR63oMjcJn06RERVMk0Q0wxx/Fys+YI6Xpgor7NuF2nRCMfoj70W3pWD2tba4eaqy4mG8mN98kf5voZoGW45QL10WAR+Iev2vdwwTCBbD/4iXcgnxdCRBeJX6iL6f3Us8Q7F34lPm4jLzRWdv0CCGie6CfEGtPcqCnD1JP/jewq4IK7w9JuhWynDzQH5mPtXXJ4bsjdgkiImEZAHgKqV8Huwh6dp6Pcu+QjXaU9TWYomVXzXjS13brxdy46+SFfJSF9qxJz+dYqa8/LSqJwhNXZB4QvmqzWzErPLzUyQRQMbsJ65xUkuNBrZhfFlKDrpwnuVlYDwmmb18VVbSL8ubN4snbngIK22STA4lWJZnNSr0sCzT+E1sp3TS/7we5SmcmBcESemNHfUHwc8+K9yJLB2DIM9Y2GgT+RhdYyTszitcTrAn/Ts8AZiG529RVatIztcCTiSda10LmgkLg130nZcKblHHkowlzwegd4oPcbobHF3ZiWHm0QcrnLhiDwBnsDF0q/mNXLJ5DiXmfJX/Y+lQjFtWx/CKhhjKRARIIduGwD DPZCIstY KO010kggTdnbJF0puy3SR2FpUBBCDj+hTzfYCOs2RBZrC2A3PrnL76hydhFOvlrQ7y75pX5sdFYTP2OsOF2DP14sG8/FYiJRwnxw+/Qa1VSgiBQJZJSzXq2Ify4l0FBuj2Www 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: Admonition constructs on the documentation use definition lists, which isn't fit for the purpose. Replace them with appropriate blocks: * Use caution:: for outdated document notice * hint:: for memo * note:: for other constructs * warning:: for memory reclaim Signed-off-by: Bagas Sanjaya --- .../admin-guide/cgroup-v1/memory.rst | 58 ++++++++++--------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/Documentation/admin-guide/cgroup-v1/memory.rst b/Documentation/admin-guide/cgroup-v1/memory.rst index 258e45cc3b2db1..ec99bcbd55c2e7 100644 --- a/Documentation/admin-guide/cgroup-v1/memory.rst +++ b/Documentation/admin-guide/cgroup-v1/memory.rst @@ -2,13 +2,13 @@ Memory Resource Controller ========================== -NOTE: +.. caution:: This document is hopelessly outdated and it asks for a complete rewrite. It still contains a useful information so we are keeping it here but make sure to check the current code if you need a deeper understanding. -NOTE: +.. note:: The Memory Resource Controller has generically been referred to as the memory controller in this document. Do not confuse memory controller used here with the memory controller that is used in hardware. @@ -276,12 +276,12 @@ The reclaim algorithm has not been modified for cgroups, except that pages that are selected for reclaiming come from the per-cgroup LRU list. -NOTE: - Reclaim does not work for the root cgroup, since we cannot set any - limits on the root cgroup. +.. note:: + Reclaim does not work for the root cgroup, since we cannot set any + limits on the root cgroup. -Note2: - When panic_on_oom is set to "2", the whole system will panic. +.. note:: + 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) @@ -369,10 +369,10 @@ U != 0, K < U: never greater than the total memory, and freely set U at the cost of his QoS. -WARNING: - In the current implementation, memory reclaim will NOT be - triggered for a cgroup when it hits K while staying below U, which makes - this setup impractical. + .. warning:: + In the current implementation, memory reclaim will NOT be triggered for + a cgroup when it hits K while staying below U, which makes this setup + impractical. U != 0, K >= U: Since kmem charges will also be fed to the user counter and reclaim will be @@ -407,16 +407,16 @@ Since now we're in the 0 cgroup, we can alter the memory limit:: # echo 4M > /sys/fs/cgroup/memory/0/memory.limit_in_bytes -NOTE: - We can use a suffix (k, K, m, M, g or G) to indicate values in kilo, - mega or gigabytes. (Here, Kilo, Mega, Giga are Kibibytes, Mebibytes, - Gibibytes.) +.. note:: + We can use a suffix (k, K, m, M, g or G) to indicate values in kilo, + mega or gigabytes. (Here, Kilo, Mega, Giga are Kibibytes, Mebibytes, + Gibibytes.) -NOTE: - We can write "-1" to reset the ``*.limit_in_bytes(unlimited)``. +.. note:: + We can write "-1" to reset the ``*.limit_in_bytes(unlimited)``. -NOTE: - We cannot set limits on the root cgroup any more. +.. note:: + We cannot set limits on the root cgroup any more. :: @@ -576,12 +576,12 @@ recent_scanned_anon VM internal parameter. (see mm/vmscan.c) recent_scanned_file VM internal parameter. (see mm/vmscan.c) ========================= ======================================== -Memo: +.. hint:: recent_rotated means recent frequency of LRU rotation. recent_scanned means recent # of scans to LRU. showing for better debug please see the code for meanings. -Note: +.. note:: Only anonymous and swap cache memory is listed as part of 'rss' stat. This should not be confused with the true 'resident set size' or the amount of physical memory used by the cgroup. @@ -712,10 +712,11 @@ If we want to change this to 1G, we can at any time use:: # echo 1G > memory.soft_limit_in_bytes -NOTE1: +.. note:: Soft limits take effect over a long period of time, since they involve reclaiming memory for balancing between memory cgroups -NOTE2: + +.. note:: It is recommended to set the soft limit always below the hard limit, otherwise the hard limit will take precedence. @@ -744,17 +745,20 @@ If you want to enable it:: # echo (some positive value) > memory.move_charge_at_immigrate -Note: +.. 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. -Note: + +.. note:: Charges are moved only when you move mm->owner, in other words, a leader of a thread group. -Note: + +.. note:: If we cannot find enough space for the task in the destination cgroup, we try to make space by reclaiming memory. Task migration may fail if we cannot make enough space. -Note: + +.. note:: It can take several seconds if you move charges much. And if you want disable it again::