From patchwork Mon Dec 19 04:22:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bagas Sanjaya X-Patchwork-Id: 13076236 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 B9A08C4332F for ; Mon, 19 Dec 2022 04:22:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 569108E0009; Sun, 18 Dec 2022 23:22:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3B9A58E0005; 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 171048E0009; Sun, 18 Dec 2022 23:22:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 024C88E0005 for ; Sun, 18 Dec 2022 23:22:26 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id D55CFA7685 for ; Mon, 19 Dec 2022 04:22:25 +0000 (UTC) X-FDA: 80257759050.14.C17EE43 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by imf26.hostedemail.com (Postfix) with ESMTP id 13A3414000A for ; Mon, 19 Dec 2022 04:22:23 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=DWj2vrOs; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf26.hostedemail.com: domain of bagasdotme@gmail.com designates 209.85.216.46 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=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=2eJ0PgV9osw1yzCFjYcppkmXI1mNsCk3sVd7FF32JKk=; b=jHTzr9P0HCVSy73M90NyGmpw44mI0pR4Vy427W9ItJ2c/wQyWuYkBKvrC+FoCLhQwsq4Mt PV1vD35xhdLIgmrI8zv1altaOnZgXFyMUoMzix6aQ2CelB0VdZ7ad0W/OQS15cFiUGLg/9 Cxfze4vJTzl+qVoRXZWKRiv6M+0NXvA= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=DWj2vrOs; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf26.hostedemail.com: domain of bagasdotme@gmail.com designates 209.85.216.46 as permitted sender) smtp.mailfrom=bagasdotme@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1671423744; a=rsa-sha256; cv=none; b=bqWjheJoZokWO434gdkt9rxKrLLj05e/m/bBXC90hzwv0hZ4RbRzfpl+1ECd7/xVLG/U6/ 6dsZnCkXnr/yKkQtKwB30YaS5zaa5xRRb1ChL5VpgQMqhbOeVe9jYLxNG2ZiaLdL6MC4fL UtFfux0T7XzA5Yi4otHzohWwLHfRlD0= Received: by mail-pj1-f46.google.com with SMTP id v23so2597435pju.3 for ; Sun, 18 Dec 2022 20:22:23 -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=2eJ0PgV9osw1yzCFjYcppkmXI1mNsCk3sVd7FF32JKk=; b=DWj2vrOsmcNcemOcEX+STJ0rY9zglo4HAd+kl6qkuHXYj1Wn+icY7bqhzZvQZPEXZq q2GE6FnBygHaxi5XvVdiki3g+eQJkl7gjZr1Q4aOMaIIXj2g3RiKjVlAvHdORhkzVuS4 LKCmZkz7m3E1QfHnWerxeT51zEUy73Fa3T0MnAL2nY3N6bvLyTDW6zbbK3pew4Out7Z8 jjk1A2g/g70jdwVtmUF1V58q7Edd24yVBJgNwr+kfc2MrzW3xE/q5mUuXT3zwr81YB8D 3Nk2RzYCxxS+IpdEdLaruJm43t6qLYaz2ZiHbbSop+4Xt9I921ssalMCYn48uELg73fN NQpA== 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=2eJ0PgV9osw1yzCFjYcppkmXI1mNsCk3sVd7FF32JKk=; b=6V0BMH02SE33Hw5pTtWCwYp9waLAriykG9nQ2gfztenzc54t7EDU+P0dUXxJeSH5+s DqXNYrenms7uEfvFQ1DcF3D6eAhbWfhFRWdqhxqgIMmUVsG7qRX7OL1yFHrtgH0NfmvV ZVzH6g3utHdq9m2e9tzeQUBeg5MWY5IRS1BEItbb7Pb6UUi8s9H8OAx6vVRyoIhRo0Kr FeZHRnvdlVLhvzDsUvP+zuL6hOdRSoZVNa6lOpGZjF8463Mk+3Ddjpmca2CTE5opW5Z7 Tp0vXoGVA2tO9HOsIU5PYIeDooVyKxcuIaDS94xB8L6e9pZv4/8oZDApZu+cm9hBgknI 72GA== X-Gm-Message-State: ANoB5pkidhKJjjYLRqTYdgdbAXJa4BROlI41wLPigHxV7YfX2DgkKNj4 +VPo07G1FU9S5Sz7/sczxuw= X-Google-Smtp-Source: AA0mqf5MV88rivDFHbXAo0wF1vc9fTd9ZJ8yZVxW/J5PoxzMPwtuA4ml+Kh2ZZH4Hkxwpc1lxQbtzg== X-Received: by 2002:a17:90a:d24f:b0:219:251f:d92d with SMTP id o15-20020a17090ad24f00b00219251fd92dmr42619785pjw.9.1671423743042; 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 h22-20020a17090a055600b0021e1c8ef788sm6768182pjf.51.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 50B64103F77; 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 10/10] docs: cgroup-v1: use numbered lists for user interface setup Date: Mon, 19 Dec 2022 11:22:09 +0700 Message-Id: <20221219042209.22898-11-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=3017; i=bagasdotme@gmail.com; h=from:subject; bh=haqtoEyuEFE5UnwPbflPC/PeHSHq/t5MqztTHGRMvxU=; b=owGbwMvMwCX2bWenZ2ig32LG02pJDMnzn31Yu6nM4+SR7DS266m3vv0SYTkjskqKnT1/2vb+2c+E 01fc6ihlYRDjYpAVU2SZlMjXdHqXkciF9rWOMHNYmUCGMHBxCsBEtCIYGSby1km+5D6Wv99W4+3DqV 9jop/ITFCZJ+BRZbfuSIH2LT6Gf7q/dRxd+6+pLdU36Xr6wNKyY9lSKyVHrU1bSjdLNW26yQIA X-Developer-Key: i=bagasdotme@gmail.com; a=openpgp; fpr=701B806FDCA5D3A58FFB8F7D7C276C64A5E44A1D X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 13A3414000A X-Stat-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XRZ6jHKT5HJdv4HCTmLpa2Vkw2Wg46xHu9XxOnUV/llnERh6gEzEnHMsp8Qlgg+dCUjoa+PDXMmmbfxL7q24A1f9+E2BqKFDYYQkEF 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: Setup instructions for memory resource controller UI uses a mix of section headings and normal paragraphs, whereas numbered lists are better fit for this purpose. While at it, also slightly reword the instructions and add reference to "Why are cgroups needed?" in the main cgroups documentation. Signed-off-by: Bagas Sanjaya --- .../admin-guide/cgroup-v1/cgroups.rst | 2 ++ .../admin-guide/cgroup-v1/memory.rst | 26 ++++++++----------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/Documentation/admin-guide/cgroup-v1/cgroups.rst b/Documentation/admin-guide/cgroup-v1/cgroups.rst index b0688011ed06de..9343148ee99366 100644 --- a/Documentation/admin-guide/cgroup-v1/cgroups.rst +++ b/Documentation/admin-guide/cgroup-v1/cgroups.rst @@ -80,6 +80,8 @@ access. For example, cpusets (see Documentation/admin-guide/cgroup-v1/cpusets.rs you to associate a set of CPUs and a set of memory nodes with the tasks in each cgroup. +.. _cgroups-why-needed: + 1.2 Why are cgroups needed ? ---------------------------- diff --git a/Documentation/admin-guide/cgroup-v1/memory.rst b/Documentation/admin-guide/cgroup-v1/memory.rst index ae3a1d3873d73b..8cd46525b19c2e 100644 --- a/Documentation/admin-guide/cgroup-v1/memory.rst +++ b/Documentation/admin-guide/cgroup-v1/memory.rst @@ -389,30 +389,30 @@ U != 0, K >= U: 3. User Interface ================= -3.0. Configuration ------------------- +To use the user interface: -a. Enable CONFIG_CGROUPS -b. Enable CONFIG_MEMCG - -3.1. Prepare the cgroups (see cgroups.txt, Why are cgroups needed?) -------------------------------------------------------------------- - -:: +1. Enable CONFIG_CGROUPS and CONFIG_MEMCG options +2. Prepare the cgroups (see :ref:`Why are cgroups needed? + ` for the background information):: # mount -t tmpfs none /sys/fs/cgroup # mkdir /sys/fs/cgroup/memory # mount -t cgroup none /sys/fs/cgroup/memory -o memory -3.2. Make the new group and move bash into it:: +3. Make the new group and move bash into it:: # mkdir /sys/fs/cgroup/memory/0 # echo $$ > /sys/fs/cgroup/memory/0/tasks -Since now we're in the 0 cgroup, we can alter the memory limit:: +4. 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 + The limit can now be queried:: + + # cat /sys/fs/cgroup/memory/0/memory.limit_in_bytes + 4194304 + .. 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, @@ -424,10 +424,6 @@ Since now we're in the 0 cgroup, we can alter the memory limit:: .. note:: We cannot set limits on the root cgroup any more. -:: - - # cat /sys/fs/cgroup/memory/0/memory.limit_in_bytes - 4194304 We can check the usage::