[Devel] [PATCH rh7] mm, oom: print information about ve of killed task
Andrey Ryabinin
aryabinin at virtuozzo.com
Wed Oct 28 08:42:21 PDT 2015
dmesg |grep Killed
Before:
Killed process 14892 (trinity-c271) total-vm:97920kB, anon-rss:2508kB, file-rss:1060kB
After:
Killed process 14892 (trinity-c271) in ve 4 total-vm:97920kB, anon-rss:2508kB, file-rss:1060kB
https://jira.sw.ru/browse/PSBM-40610
Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
mm/oom_kill.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 71d88ad..5744e1b 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -875,10 +875,13 @@ void oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
/* mm cannot safely be dereferenced after task_unlock(victim) */
mm = victim->mm;
mark_oom_victim(victim);
- pr_err("Killed process %d (%s) total-vm:%lukB, anon-rss:%lukB, file-rss:%lukB\n",
- task_pid_nr(victim), victim->comm, K(victim->mm->total_vm),
+ rcu_read_lock();
+ pr_err("Killed process %d (%s) in ve %s total-vm:%lukB, anon-rss:%lukB, file-rss:%lukB\n",
+ task_pid_nr(victim), victim->comm, task_ve_name(victim),
+ K(victim->mm->total_vm),
K(get_mm_counter(victim->mm, MM_ANONPAGES)),
K(get_mm_counter(victim->mm, MM_FILEPAGES)));
+ rcu_read_unlock();
task_unlock(victim);
/*
@@ -898,8 +901,8 @@ void oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
continue;
task_lock(p); /* Protect ->comm from prctl() */
- pr_err("Kill process %d (%s) sharing same memory\n",
- task_pid_nr(p), p->comm);
+ pr_err("Kill process %d (%s) in ve %s sharing same memory\n",
+ task_pid_nr(p), p->comm, task_ve_name(p));
task_unlock(p);
do_send_sig_info(SIGKILL, SEND_SIG_FORCED, p, true);
mem_cgroup_note_oom_kill(memcg, p);
--
2.4.10
More information about the Devel
mailing list