Commit 8202acc6 authored by zhaoxiaoqiang11's avatar zhaoxiaoqiang11
Browse files

memcg/swap: add ability to disable memcg swap

jingdong inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I8AQ5E



--------------------------------------------------

in cloud native environment, we need to disable container swap
and enable it only in special cases.

Usage:
echo 2 > /proc/sys/vm/memcg_swap_qos_enable to enable this new feature.

Note:
some write operation will be invalid

Valid change:
0 => 1 (enable swap qos, SWAP_TYPE_ALL)
0 => 2 (enable swap qos, SWAP_TYPE_NONE)
1 => 0 (disable swap qos)
2 => 0 (disable swap qos)

Invalid change:
1 => 2 (SWAP_TYPE_ALL => SWAP_TYPE_NONE)
2 => 1 (SWAP_TYPE_NONE => SWAP_TYPE_ALL)
and write operation will return -EINVAL

Signed-off-by: default avatarzhaoxiaoqiang11 <zhaoxiaoqiang11@jd.com>
Reviewed-by: default avatarzhangwei123171 <zhangwei123171@jd.com>
parent 3e491e57
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment