From 79fc97e0ebf6630830f2efd2b9ae4532932b2bce Mon Sep 17 00:00:00 2001 From: Liam Mark Date: Tue, 3 Jun 2014 13:33:18 -0700 Subject: mm, oom: make dump_tasks public Allow other functions to dump the list of tasks. Useful for when debugging memory leaks. Change-Id: I76c33a118a9765b4c2276e8c76de36399c78dbf6 Signed-off-by: Liam Mark --- include/linux/oom.h | 3 +++ mm/oom_kill.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/linux/oom.h b/include/linux/oom.h index 297cda528..b16a9f5ab 100644 --- a/include/linux/oom.h +++ b/include/linux/oom.h @@ -87,6 +87,9 @@ static inline void oom_killer_enable(void) extern struct task_struct *find_lock_task_mm(struct task_struct *p); +extern void dump_tasks(const struct mem_cgroup *memcg, + const nodemask_t *nodemask); + /* sysctls */ extern int sysctl_oom_dump_tasks; extern int sysctl_oom_kill_allocating_task; diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 1a15cc0e1..24a437368 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -363,7 +363,7 @@ static struct task_struct *select_bad_process(unsigned int *ppoints, * State information includes task's pid, uid, tgid, vm size, rss, nr_ptes, * swapents, oom_score_adj value, and name. */ -static void dump_tasks(const struct mem_cgroup *memcg, const nodemask_t *nodemask) +void dump_tasks(const struct mem_cgroup *memcg, const nodemask_t *nodemask) { struct task_struct *p; struct task_struct *task; -- cgit v1.2.3