[Devel] [PATCH RHEL7 COMMIT] ve/proc: use memcg limits for showing oom_score inside CT
Konstantin Khorenko
khorenko at virtuozzo.com
Mon Jun 8 09:09:49 PDT 2015
The commit is pushed to "branch-rh7-3.10.0-123.1.2-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-123.1.2.vz7.5.11
------>
commit b40aa1a96542108b52b3a6c1087dcb29f8bae4f8
Author: Vladimir Davydov <vdavydov at parallels.com>
Date: Mon Jun 8 20:09:49 2015 +0400
ve/proc: use memcg limits for showing oom_score inside CT
Series description:
This patch /proc/PID/{oom_score_adj,oom_adj,oom_score} behavior inside a
CT, resurrecting /proc/vz/oom_score_adj along the way. For more details,
see individual patches.
https://jira.sw.ru/browse/PSBM-33849
====================================================================
This patch description:
Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
Acked-by: Andrew Vagin <avagin at odin.com>
---
fs/proc/base.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 9555e58..f551cff 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -449,6 +449,9 @@ static int proc_oom_score(struct task_struct *task, char *buffer)
unsigned long totalpages = totalram_pages + total_swap_pages;
unsigned long points = 0;
+ if (!ve_is_super(get_exec_env()))
+ totalpages = min(totalpages, mem_cgroup_total_pages(true));
+
read_lock(&tasklist_lock);
if (pid_alive(task))
points = oom_badness(task, NULL, NULL, totalpages) *
More information about the Devel
mailing list