[Devel] [PATCH rh7 2/6] proc: use memcg limits for showing oom_score inside CT

Vladimir Davydov vdavydov at parallels.com
Wed Jun 3 07:56:49 PDT 2015


Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
---
 fs/proc/base.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/proc/base.c b/fs/proc/base.c
index caa530c34ba4..5e3bbb84520b 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -450,6 +450,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) *
-- 
2.1.4




More information about the Devel mailing list