Skip to content

Commit 56eb276

Browse files
bagasmehtejun
authored andcommitted
docs: cgroup-v1: replace custom note constructs with appropriate admonition blocks
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 <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent 21786e5 commit 56eb276

File tree

1 file changed

+31
-27
lines changed

1 file changed

+31
-27
lines changed

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

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
Memory Resource Controller
33
==========================
44

5-
NOTE:
5+
.. caution::
66
This document is hopelessly outdated and it asks for a complete
77
rewrite. It still contains a useful information so we are keeping it
88
here but make sure to check the current code if you need a deeper
99
understanding.
1010

11-
NOTE:
11+
.. note::
1212
The Memory Resource Controller has generically been referred to as the
1313
memory controller in this document. Do not confuse memory controller
1414
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
274274
pages that are selected for reclaiming come from the per-cgroup LRU
275275
list.
276276

277-
NOTE:
278-
Reclaim does not work for the root cgroup, since we cannot set any
279-
limits on the root cgroup.
277+
.. note::
278+
Reclaim does not work for the root cgroup, since we cannot set any
279+
limits on the root cgroup.
280280

281-
Note2:
282-
When panic_on_oom is set to "2", the whole system will panic.
281+
.. note::
282+
When panic_on_oom is set to "2", the whole system will panic.
283283

284284
When oom event notifier is registered, event will be delivered.
285285
(See oom_control section)
@@ -367,10 +367,10 @@ U != 0, K < U:
367367
never greater than the total memory, and freely set U at the cost of his
368368
QoS.
369369

370-
WARNING:
371-
In the current implementation, memory reclaim will NOT be
372-
triggered for a cgroup when it hits K while staying below U, which makes
373-
this setup impractical.
370+
.. warning::
371+
In the current implementation, memory reclaim will NOT be triggered for
372+
a cgroup when it hits K while staying below U, which makes this setup
373+
impractical.
374374

375375
U != 0, K >= U:
376376
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::
405405

406406
# echo 4M > /sys/fs/cgroup/memory/0/memory.limit_in_bytes
407407

408-
NOTE:
409-
We can use a suffix (k, K, m, M, g or G) to indicate values in kilo,
410-
mega or gigabytes. (Here, Kilo, Mega, Giga are Kibibytes, Mebibytes,
411-
Gibibytes.)
408+
.. note::
409+
We can use a suffix (k, K, m, M, g or G) to indicate values in kilo,
410+
mega or gigabytes. (Here, Kilo, Mega, Giga are Kibibytes, Mebibytes,
411+
Gibibytes.)
412412

413-
NOTE:
414-
We can write "-1" to reset the ``*.limit_in_bytes(unlimited)``.
413+
.. note::
414+
We can write "-1" to reset the ``*.limit_in_bytes(unlimited)``.
415415

416-
NOTE:
417-
We cannot set limits on the root cgroup any more.
416+
.. note::
417+
We cannot set limits on the root cgroup any more.
418418

419419
::
420420

@@ -574,12 +574,12 @@ recent_scanned_anon VM internal parameter. (see mm/vmscan.c)
574574
recent_scanned_file VM internal parameter. (see mm/vmscan.c)
575575
========================= ========================================
576576

577-
Memo:
577+
.. hint::
578578
recent_rotated means recent frequency of LRU rotation.
579579
recent_scanned means recent # of scans to LRU.
580580
showing for better debug please see the code for meanings.
581581

582-
Note:
582+
.. note::
583583
Only anonymous and swap cache memory is listed as part of 'rss' stat.
584584
This should not be confused with the true 'resident set size' or the
585585
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::
710710

711711
# echo 1G > memory.soft_limit_in_bytes
712712

713-
NOTE1:
713+
.. note::
714714
Soft limits take effect over a long period of time, since they involve
715715
reclaiming memory for balancing between memory cgroups
716-
NOTE2:
716+
717+
.. note::
717718
It is recommended to set the soft limit always below the hard limit,
718719
otherwise the hard limit will take precedence.
719720

@@ -735,17 +736,20 @@ If you want to enable it::
735736

736737
# echo (some positive value) > memory.move_charge_at_immigrate
737738

738-
Note:
739+
.. note::
739740
Each bits of move_charge_at_immigrate has its own meaning about what type
740741
of charges should be moved. See 8.2 for details.
741-
Note:
742+
743+
.. note::
742744
Charges are moved only when you move mm->owner, in other words,
743745
a leader of a thread group.
744-
Note:
746+
747+
.. note::
745748
If we cannot find enough space for the task in the destination cgroup, we
746749
try to make space by reclaiming memory. Task migration may fail if we
747750
cannot make enough space.
748-
Note:
751+
752+
.. note::
749753
It can take several seconds if you move charges much.
750754

751755
And if you want disable it again::

0 commit comments

Comments
 (0)