提交 0c8648d9 编写于 作者: W Wenwei Tao 提交者: Shile Zhang

alinux: doc: alibaba: Add priority oom descriptions

Add "memory.priority" and "memory.use_priority_oom" descriptions.
Signed-off-by: NWenwei Tao <wenwei.tao@linux.alibaba.com>
Reviewed-by: NYang Shi <yang.shi@linux.alibaba.com>
上级 52e375fc
......@@ -122,3 +122,48 @@ zombie memcgs reaper
- /sys/kernel/mm/memcg_reaper/reap
users write "1" to trigger one round of zombie memcg reaping.
memory.priority
===============
Under memory pressure, reclaim and oom would happen, with multiple
cgroups exist in one system, we might want some of the cgroups's memory
or tasks survived the reclaim and oom while there are other candidates.
The "memory.low" and "memory.min" make that happen during reclaim, this
"memory.priority" introduces a priority oom to meet above requirement
in oom.
The priority value is from 0 to 12, the higher number the higher priority.
The priority is among siblings, it is not global priority, by this we can
map these 13 priorities to the tens of thousands of memcgs.
When oom happens it first chooses the lowest priority memcg as victim then
uses the kernel default algorithm(see function oom_evaluate_task()) to select
bad process from the victim memcg.
For example::
The following hierarchy:
root
/ \
A B
/ \ / \
C D E F
priority:
A: 10, B: 8
C: 5, D: 6, E: 7, F: 8
When oom happens in root, it first iterates its two children A and B, and selects
B as next iteration root since B's priority is lower than A, subsequent victim
selection is limit in the B's subtree. E is selected as victim memcg finally, since
its priority is lower than its sibling.
This priority oom works both for memcg and global oom. For global oom the root is
root memcg.
memory.use_priority_oom
=======================
This file is used to enable/disable priority oom.
Write "1" to enable the priority oom and "0" to disable it.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册