2
2
Memory Resource Controller
3
3
==========================
4
4
5
- NOTE :
5
+ .. caution : :
6
6
This document is hopelessly outdated and it asks for a complete
7
7
rewrite. It still contains a useful information so we are keeping it
8
8
here but make sure to check the current code if you need a deeper
9
9
understanding.
10
10
11
- NOTE :
11
+ .. note : :
12
12
The Memory Resource Controller has generically been referred to as the
13
13
memory controller in this document. Do not confuse memory controller
14
14
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
274
274
pages that are selected for reclaiming come from the per-cgroup LRU
275
275
list.
276
276
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.
280
280
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.
283
283
284
284
When oom event notifier is registered, event will be delivered.
285
285
(See oom_control section)
@@ -367,10 +367,10 @@ U != 0, K < U:
367
367
never greater than the total memory, and freely set U at the cost of his
368
368
QoS.
369
369
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.
374
374
375
375
U != 0, K >= U:
376
376
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::
405
405
406
406
# echo 4M > /sys/fs/cgroup/memory/0/memory.limit_in_bytes
407
407
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.)
412
412
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) ``.
415
415
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.
418
418
419
419
::
420
420
@@ -574,12 +574,12 @@ recent_scanned_anon VM internal parameter. (see mm/vmscan.c)
574
574
recent_scanned_file VM internal parameter. (see mm/vmscan.c)
575
575
========================= ========================================
576
576
577
- Memo :
577
+ .. hint : :
578
578
recent_rotated means recent frequency of LRU rotation.
579
579
recent_scanned means recent # of scans to LRU.
580
580
showing for better debug please see the code for meanings.
581
581
582
- Note :
582
+ .. note : :
583
583
Only anonymous and swap cache memory is listed as part of 'rss' stat.
584
584
This should not be confused with the true 'resident set size' or the
585
585
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::
710
710
711
711
# echo 1G > memory.soft_limit_in_bytes
712
712
713
- NOTE1 :
713
+ .. note : :
714
714
Soft limits take effect over a long period of time, since they involve
715
715
reclaiming memory for balancing between memory cgroups
716
- NOTE2:
716
+
717
+ .. note ::
717
718
It is recommended to set the soft limit always below the hard limit,
718
719
otherwise the hard limit will take precedence.
719
720
@@ -735,17 +736,20 @@ If you want to enable it::
735
736
736
737
# echo (some positive value) > memory.move_charge_at_immigrate
737
738
738
- Note :
739
+ .. note : :
739
740
Each bits of move_charge_at_immigrate has its own meaning about what type
740
741
of charges should be moved. See 8.2 for details.
741
- Note:
742
+
743
+ .. note ::
742
744
Charges are moved only when you move mm->owner, in other words,
743
745
a leader of a thread group.
744
- Note:
746
+
747
+ .. note ::
745
748
If we cannot find enough space for the task in the destination cgroup, we
746
749
try to make space by reclaiming memory. Task migration may fail if we
747
750
cannot make enough space.
748
- Note:
751
+
752
+ .. note ::
749
753
It can take several seconds if you move charges much.
750
754
751
755
And if you want disable it again::
0 commit comments