From patchwork Thu Jan 5 13:16:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bagas Sanjaya X-Patchwork-Id: 13089867 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 ED110C3DA7A for ; Thu, 5 Jan 2023 13:17:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CB4FE940007; Thu, 5 Jan 2023 08:17:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C649A900009; Thu, 5 Jan 2023 08:17:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A395C940008; Thu, 5 Jan 2023 08:17:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 92E98900009 for ; Thu, 5 Jan 2023 08:17:12 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 6FDE6A0CA6 for ; Thu, 5 Jan 2023 13:17:12 +0000 (UTC) X-FDA: 80320796304.22.C897557 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by imf07.hostedemail.com (Postfix) with ESMTP id 9461140012 for ; Thu, 5 Jan 2023 13:17:10 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=iCXg4LXU; spf=pass (imf07.hostedemail.com: domain of bagasdotme@gmail.com designates 209.85.214.180 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=1672924630; 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=/8J8qW+Vq8pd6T9oMP3SU6TUuvWLiPg70zvs+kZ90og=; b=yaWS/JqleLnK85lA/BYsB5pKyun2/1HbtrI2YiBaKWWEjl3O3mpMePd29EYbe8xrsSnno2 t2d/80K3T7Y7yVAPG0Ko+Ir9HJnx1lyLz70p76n8iMnx70BpmU8X5yfbMt9l9OITWhTeO+ NbwliaY7ScoSECIixee0lp63ruJJ/w0= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=iCXg4LXU; spf=pass (imf07.hostedemail.com: domain of bagasdotme@gmail.com designates 209.85.214.180 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=1672924630; a=rsa-sha256; cv=none; b=fb0loRE/RUAOrZdQcSDBph/kcLTRosAVUFdE5oUy1im5hLmObGQEj2Hzzv2X71pxfwf/Pz 9CBEuMuYs+mllnFf4M3KSS2A3g9H9gtNbjklDNK6WrolggZ8r1mRJVjW0CLHq1cNsxIj3G bXf4FQoabSqUg+zsJ+fb9eve8c4ieBQ= Received: by mail-pl1-f180.google.com with SMTP id jl4so33030295plb.8 for ; Thu, 05 Jan 2023 05:17:10 -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=/8J8qW+Vq8pd6T9oMP3SU6TUuvWLiPg70zvs+kZ90og=; b=iCXg4LXUCBckmKqWrrrxIf26SHrZFmi22auf4ZaicKRigcxRH4J1pPKSfOGqGrx+70 2Dz9hHlbyfiE4Ej5uw8WLiINWCrDAzbB2ANP3+/gbqzdOwBY6PAVA7BUZTzjTjN9cnpk w7tPekaV9ZL3vtm3yJhU/niRomQUa/kb4CWyJH8y8iuAh/qLPl6JCDrc6ste8rMI94Vb txsfBlJ+2NXRQscx4WGe5FgfV4qryQy/us+G8v74ohmJ9dZ1/1Yydjnm5pMDR4CGIFWd rFyAaog+Q+WI+4vFL84NNY7n+NkZ1tRC3x6sboqGdsT7/ikXBHb5637YYaiNJOQxgOy1 wIXQ== 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=/8J8qW+Vq8pd6T9oMP3SU6TUuvWLiPg70zvs+kZ90og=; b=dRoQGUu/kK7M2J7mf4h0wYKJ1bjjjECtKHn7CyHvQu8MWNEMALsiz08v1gZO72hXv3 tHDe3zwDC+lrv+KzY4sjWkEgIQcqX7jObO4vmKEEuFKhyL0UlgtxMWLZeRzvYde2ajcv 2rDLr6PduB7Ve0UKW1bkwqwuSLXa6ZEuftLOhhf6sEFmaM8WWpTtrV8oH7iZ3ZMwNAMD /6u2lGpoVAGjAH71xhWBgPu8hTp7gotTf449mX8r6kFCf0gi3L81qw4CjSFftde5HQTp /bgYj8TtZDyhOkgj1lY9C5eZ9r5RQFDmsgthz/42ynDz3ZjYtbauVd50Mxm/TDXYmShS Pheg== X-Gm-Message-State: AFqh2krF/JD+NJ3vay85WOqC+zJLIh3gpVmcznRVvrlZaDdjGGYDQ/TN yeB/5ET45UpVy8eiuu19Jfo= X-Google-Smtp-Source: AMrXdXslOn7z2k07aal+6cIKgoQ5LswkwnJ95kNaoSJyQRPK/amOfoIBRXrc2Nm+i57mpW0/cAM3qw== X-Received: by 2002:a05:6a20:4295:b0:a8:8714:233b with SMTP id o21-20020a056a20429500b000a88714233bmr80647372pzj.57.1672924630106; Thu, 05 Jan 2023 05:17:10 -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 q7-20020a170902a3c700b0018997f6fc88sm10893264plb.34.2023.01.05.05.17.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 05:17:09 -0800 (PST) Received: by debian.me (Postfix, from userid 1000) id 8148B105232; Thu, 5 Jan 2023 20:17:00 +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 9/9] docs: cgroup-v1: use numbered lists for user interface setup Date: Thu, 5 Jan 2023 20:16:34 +0700 Message-Id: <20230105131633.553574-10-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=3017; i=bagasdotme@gmail.com; h=from:subject; bh=nysWUkfThi/UCTzfZAv3ZXQWTYDkn/SrXnv8ebwTGco=; b=owGbwMvMwCX2bWenZ2ig32LG02pJDMnbzm5cWtCq0ng04TEHZ7mB8SLVvBOR8ztZH9yf/zX6aJlM um9YRykLgxgXg6yYIsukRL6m07uMRC60r3WEmcPKBDKEgYtTACbibcPwT83d3Ur0YVzhzYLHnCdO+i /VN2/wf6tmmSycLGTr8LlwKsN/L4kJ/ZbNi2Kc+F4s8DBN49CYLV1rXfH+fJz40j4rB2VOAA== X-Developer-Key: i=bagasdotme@gmail.com; a=openpgp; fpr=701B806FDCA5D3A58FFB8F7D7C276C64A5E44A1D X-Rspamd-Queue-Id: 9461140012 X-Stat-Signature: 4t4zsan6j99397h9573pfqai1umckqwu X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1672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LLWqxl1CzAVdcNInWadX8Vf2TXfDueNRUaN/yfoeqHnvGf 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 16d938abe69f81..27d89495ac880a 100644 --- a/Documentation/admin-guide/cgroup-v1/memory.rst +++ b/Documentation/admin-guide/cgroup-v1/memory.rst @@ -387,30 +387,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, @@ -422,10 +422,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::