lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:   Wed,  4 Jul 2018 12:23:18 -0300
From:   Rodrigo Freire <rfreire@...hat.com>
To:     linux-mm@...ck.org
Cc:     linux-kernel@...r.kernel.org, aquini@...hat.com,
        rientjes@...gle.com
Subject: [PATCH v2] mm, oom: Describe task memory unit, larger PID pad

The default page memory unit of OOM task dump events might not be
intuitive and potentially misleading for the non-initiated when
debugging OOM events: These are pages and not kBs. Add a small
printk prior to the task dump informing that the memory units are
actually memory _pages_.

Also extends PID field to align on up to 7 characters.
References: https://lkml.org/lkml/2018/7/3/1201

Signed-off-by: Rodrigo Freire <rfreire@...hat.com>
Acked-by: David Rientjes <rientjes@...gle.com>
Acked-by: Rafael Aquini <aquini@...hat.com>
---
 mm/oom_kill.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 84081e7..520a483 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -392,7 +392,8 @@ static void dump_tasks(struct mem_cgroup *memcg, const nodemask_t *nodemask)
 	struct task_struct *p;
 	struct task_struct *task;
 
-	pr_info("[ pid ]   uid  tgid total_vm      rss pgtables_bytes swapents oom_score_adj name\n");
+	pr_info("Tasks state (memory values in pages):\n");
+	pr_info("[  pid  ]   uid  tgid total_vm      rss pgtables_bytes swapents oom_score_adj name\n");
 	rcu_read_lock();
 	for_each_process(p) {
 		if (oom_unkillable_task(p, memcg, nodemask))
@@ -408,7 +409,7 @@ static void dump_tasks(struct mem_cgroup *memcg, const nodemask_t *nodemask)
 			continue;
 		}
 
-		pr_info("[%5d] %5d %5d %8lu %8lu %8ld %8lu         %5hd %s\n",
+		pr_info("[%7d] %5d %5d %8lu %8lu %8ld %8lu         %5hd %s\n",
 			task->pid, from_kuid(&init_user_ns, task_uid(task)),
 			task->tgid, task->mm->total_vm, get_mm_rss(task->mm),
 			mm_pgtables_bytes(task->mm),
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ