From patchwork Thu Jan 5 13:16:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bagas Sanjaya X-Patchwork-Id: 13089862 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 44D08C3DA7A for ; Thu, 5 Jan 2023 13:17:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F24D6900004; Thu, 5 Jan 2023 08:17:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id ED631900003; Thu, 5 Jan 2023 08:17:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D4DFC900004; Thu, 5 Jan 2023 08:17:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id C61C9900003 for ; Thu, 5 Jan 2023 08:17:09 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id ACA01C09D3 for ; Thu, 5 Jan 2023 13:17:09 +0000 (UTC) X-FDA: 80320796178.19.230CE28 Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by imf15.hostedemail.com (Postfix) with ESMTP id C1DFEA0012 for ; Thu, 5 Jan 2023 13:17:07 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=KZ7VuUCI; spf=pass (imf15.hostedemail.com: domain of bagasdotme@gmail.com designates 209.85.216.43 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=1672924627; a=rsa-sha256; cv=none; b=GAyyyl3ZslG3IJXmtAYokgOMyBYu3H/SOMMnAhB5/7s3o8Yh61TG3KLc/uEMU6Jg7sOCRR n9mbHuEeFihlcuZZ/H/0forBL1prlHNLRlhAfGgcCemM9JPns4Fh3F1zBJB4NPNAzuV9ks +3WjrZbJSv97kDDZ8AhHbBfpbCqDwas= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=KZ7VuUCI; spf=pass (imf15.hostedemail.com: domain of bagasdotme@gmail.com designates 209.85.216.43 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=1672924627; 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=kEyDN1DoPB92rHtz9Bu6YtukEjhpZoR1SaNfSfYIFW4=; b=68qvELmXnjJ2YnHvDEpi6YXkEUv7X2cLvJzCMjJppz3Nr1v8Y1bE1yo0sNO89DD4JxYQ9M BDruWiM7qy5rxbl5BHdfS2t2ZV+At69mjlKaxdGkMEO8ByF5AxTKOeChi5bZcbN4IOXiPi m/X2ILNRHfOFAz1qzhmJSR7+9MjIEkk= Received: by mail-pj1-f43.google.com with SMTP id cl14so3350107pjb.2 for ; Thu, 05 Jan 2023 05:17:07 -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=kEyDN1DoPB92rHtz9Bu6YtukEjhpZoR1SaNfSfYIFW4=; b=KZ7VuUCIf/RIhfW0Ha0Xh1OvaTK8RR2Ace8AZf12WVCOnGaDE++Tuix77O0TG+tqiI UWbd7O/vXR0K9zscx6A2zOnv4chr/TVaiURpCNyhxVrNgpvVq+IGIwz7lfE/M1oPlINT NOImTaNK7y8SYUX9EPUpfeB+pyGG+UOwZJWLFHpvj9UKA2txvhk4n80kTWxu4ASs586K ZZEhS3Z5gKACg1SwAWYMQXZ6lTapo9WARtjcGi9fJorXpCMpiMmKe1majuwpBybQ57ct aDlKlivxjCkkztxSPZMmfGBDQO3qVzGV7zDAJZOreudO+D52wAYUJ/ZO0UBifALXXsuJ P4xw== 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=kEyDN1DoPB92rHtz9Bu6YtukEjhpZoR1SaNfSfYIFW4=; b=GD4hw8HzVNZwuBAb3oQtPQ9fCYAczEu1c7cQvyVoCA0ifLrvPgWGul1OznJXf0KOSd v7HJQhOMnsoJHaOr66pndSxD5NL8+qtpLlb2qi9xMpKcyfBKPDYVVRUtmfr3rnOt8LRW x2yisfaSpJrLuh432mqzNZQKjMgvm7GgJR/LlXvj4Ss0D5kYl1DNA+rdZMfdWU3wHgsI HIV6ldJ8eRo7N67BRnFTUUJFFdMo7oiyWV0kW/4xu4YuQ3oJHjkodeMDqsT8y0fEBQYi Ma3gXZR6rdNakxnYngjH4YxnkXkgJP3Mc6ePesPFwsY8wwhCjmkvE7BIdh8mhkP0hpre os2A== X-Gm-Message-State: AFqh2kpbw/4HMLnX/fWYRqGOoyLmyS6ryMvb/g388vUzvI9M361t+1Qm QK9rJDKepPnrr4mtDI3fLmw= X-Google-Smtp-Source: AMrXdXua9EXcDqeZze7Fj7qX9Z1Mtd3h5heZGEbc9ZeNK053ZyPPuHU+uBZFwPujwGzBi1MnYiCLlQ== X-Received: by 2002:a17:90a:e545:b0:226:2332:a3fd with SMTP id ei5-20020a17090ae54500b002262332a3fdmr29442612pjb.5.1672924626731; Thu, 05 Jan 2023 05:17:06 -0800 (PST) Received: from debian.me (subs02-180-214-232-68.three.co.id. [180.214.232.68]) by smtp.gmail.com with ESMTPSA id nn2-20020a17090b38c200b001df264610c4sm4161995pjb.0.2023.01.05.05.17.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 05:17:05 -0800 (PST) Received: by debian.me (Postfix, from userid 1000) id 7BD531042DE; Thu, 5 Jan 2023 20:16:59 +0700 (WIB) From: Bagas Sanjaya To: Linux CGroups , Linux Documentation , LKML , 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 v2 1/9] docs: cgroup-v1: replace custom note constructs with appropriate admonition blocks Date: Thu, 5 Jan 2023 20:16:26 +0700 Message-Id: <20230105131633.553574-2-bagasdotme@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230105131633.553574-1-bagasdotme@gmail.com> References: <20230105131633.553574-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=DlZUnry3AswBM9GzCcO9SGcvMxRqxgXh0Yg3NkkBNXs=; b=owGbwMvMwCX2bWenZ2ig32LG02pJDMnbzq6zkfwiJlWTZq4w3UpyzsfuB5u2XBOcKPWCf9efiZ8l TRiEO0pZGMS4GGTFFFkmJfI1nd5lJHKhfa0jzBxWJpAhDFycAjCRxUsZfrPHF16fd5hv0fNbsQuerm Hv9+Q/dKNXRJdnxrNENY8Iw9UM/9359n8NbLm8K+J17eds1aCraype/s+5+KVnt4jYtvkLeVgB X-Developer-Key: i=bagasdotme@gmail.com; a=openpgp; fpr=701B806FDCA5D3A58FFB8F7D7C276C64A5E44A1D X-Rspam-User: X-Rspamd-Queue-Id: C1DFEA0012 X-Rspamd-Server: rspam01 X-Stat-Signature: unudt89a3qgd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ki6v7BgNEGIie3TV8fyPsCSwEOmUg0/pFT3zax+WWnQM/MA53SalofeL 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 60370f2c67b99c..d0d8c780cb6bd9 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. @@ -274,12 +274,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) @@ -367,10 +367,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 @@ -405,16 +405,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. :: @@ -574,12 +574,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. @@ -710,10 +710,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. @@ -735,17 +736,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::