Skip to content

Commit 980660c

Browse files
bagasmehtejun
authored andcommitted
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 <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent da3ad2e commit 980660c

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

Documentation/admin-guide/cgroup-v1/cgroups.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ access. For example, cpusets (see Documentation/admin-guide/cgroup-v1/cpusets.rs
8080
you to associate a set of CPUs and a set of memory nodes with the
8181
tasks in each cgroup.
8282

83+
.. _cgroups-why-needed:
84+
8385
1.2 Why are cgroups needed ?
8486
----------------------------
8587

Documentation/admin-guide/cgroup-v1/memory.rst

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -387,30 +387,30 @@ U != 0, K >= U:
387387
3. User Interface
388388
=================
389389

390-
3.0. Configuration
391-
------------------
392-
393-
a. Enable CONFIG_CGROUPS
394-
b. Enable CONFIG_MEMCG
395-
396-
3.1. Prepare the cgroups (see cgroups.txt, Why are cgroups needed?)
397-
-------------------------------------------------------------------
390+
To use the user interface:
398391

399-
::
392+
1. Enable CONFIG_CGROUPS and CONFIG_MEMCG options
393+
2. Prepare the cgroups (see :ref:`Why are cgroups needed?
394+
<cgroups-why-needed>` for the background information)::
400395

401396
# mount -t tmpfs none /sys/fs/cgroup
402397
# mkdir /sys/fs/cgroup/memory
403398
# mount -t cgroup none /sys/fs/cgroup/memory -o memory
404399

405-
3.2. Make the new group and move bash into it::
400+
3. Make the new group and move bash into it::
406401

407402
# mkdir /sys/fs/cgroup/memory/0
408403
# echo $$ > /sys/fs/cgroup/memory/0/tasks
409404

410-
Since now we're in the 0 cgroup, we can alter the memory limit::
405+
4. Since now we're in the 0 cgroup, we can alter the memory limit::
411406

412407
# echo 4M > /sys/fs/cgroup/memory/0/memory.limit_in_bytes
413408

409+
The limit can now be queried::
410+
411+
# cat /sys/fs/cgroup/memory/0/memory.limit_in_bytes
412+
4194304
413+
414414
.. note::
415415
We can use a suffix (k, K, m, M, g or G) to indicate values in kilo,
416416
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::
422422
.. note::
423423
We cannot set limits on the root cgroup any more.
424424

425-
::
426-
427-
# cat /sys/fs/cgroup/memory/0/memory.limit_in_bytes
428-
4194304
429425

430426
We can check the usage::
431427

0 commit comments

Comments
 (0)