[Devel] [PATCH RHEL7 COMMIT] ve/mm: print OOM info to VE log
Konstantin Khorenko
khorenko at virtuozzo.com
Fri Jun 5 03:23:01 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.9
------>
commit 416feaf243a89acf476a3e141184d3bd97373cbf
Author: Vladimir Davydov <vdavydov at parallels.com>
Date: Fri Jun 5 14:23:01 2015 +0400
ve/mm: print OOM info to VE log
We cannot print to VE log from oom_kill_process as we do in RH6, because
there is no more set_exec_env, so do it from exit_mm.
Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
---
kernel/exit.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/kernel/exit.c b/kernel/exit.c
index 52ce91e..3e79c21 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -465,6 +465,19 @@ static void exit_mm(struct task_struct * tsk)
if (!mm)
return;
sync_mm_rss(mm);
+
+#ifdef CONFIG_VE
+#define K(x) ((x) << (PAGE_SHIFT-10))
+ if (tsk->task_ve != &ve0 &&
+ test_tsk_thread_flag(tsk, TIF_MEMDIE))
+ ve_printk(VE_LOG, KERN_ERR "OOM killed process %d (%s) "
+ "total-vm:%lukB, anon-rss:%lukB, file-rss:%lukB\n",
+ task_pid_vnr(tsk), tsk->comm, K(mm->total_vm),
+ K(get_mm_counter(mm, MM_ANONPAGES)),
+ K(get_mm_counter(mm, MM_FILEPAGES)));
+#undef K
+#endif
+
/*
* Serialize with any possible pending coredump.
* We must hold mmap_sem around checking core_state
More information about the Devel
mailing list