aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Documentation/admin-guide/cgroup-v1/memory.rst
diff options
context:
space:
mode:
authorBagas Sanjaya <bagasdotme@gmail.com>2023-01-05 20:16:34 +0700
committerTejun Heo <tj@kernel.org>2023-01-05 07:38:11 -1000
commit980660cae7994ab03b31b2a32940c70e8421fc99 (patch)
tree356c104fcc4a795ccc5fcf5558b588f8e6edb602 /Documentation/admin-guide/cgroup-v1/memory.rst
parentdocs: cgroup-v1: add internal cross-references (diff)
downloadwireguard-linux-980660cae7994ab03b31b2a32940c70e8421fc99.tar.xz
wireguard-linux-980660cae7994ab03b31b2a32940c70e8421fc99.zip
docs: cgroup-v1: use numbered lists for user interface setup
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 <bagasdotme@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'Documentation/admin-guide/cgroup-v1/memory.rst')
-rw-r--r--Documentation/admin-guide/cgroup-v1/memory.rst26
1 files changed, 11 insertions, 15 deletions
diff --git a/Documentation/admin-guide/cgroup-v1/memory.rst b/Documentation/admin-guide/cgroup-v1/memory.rst
index 16d938abe69f..27d89495ac88 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
-------------------
-
-a. Enable CONFIG_CGROUPS
-b. Enable CONFIG_MEMCG
-
-3.1. Prepare the cgroups (see cgroups.txt, Why are cgroups needed?)
--------------------------------------------------------------------
+To use the user interface:
-::
+1. Enable CONFIG_CGROUPS and CONFIG_MEMCG options
+2. Prepare the cgroups (see :ref:`Why are cgroups needed?
+ <cgroups-why-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::