Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99f13d95 authored by Charan Teja Reddy's avatar Charan Teja Reddy Committed by Gerrit - the friendly Code Review server
Browse files

mm: oom_kill: dump info of all tasks when the FG process is killed



Dump the memory information of all tasks when the foreground
process is killed and oom reaped.

Change-Id: I3183f8893442d2597f2fc1cd6d092d9807226b2f
Signed-off-by: default avatarCharan Teja Reddy <charante@codeaurora.org>
[isaacm@codeaurora.org: invoke dump_tasks with OC structure ptr]
Signed-off-by: default avatarIsaac J. Manjarres <isaacm@codeaurora.org>
parent 96fb63ca
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -1158,6 +1158,10 @@ void pagefault_out_of_memory(void)

void add_to_oom_reaper(struct task_struct *p)
{
	static DEFINE_RATELIMIT_STATE(reaper_rs, DEFAULT_RATELIMIT_INTERVAL,
						 DEFAULT_RATELIMIT_BURST);
	struct oom_control oc = {};

	if (!sysctl_reap_mem_on_sigkill)
		return;

@@ -1171,5 +1175,13 @@ void add_to_oom_reaper(struct task_struct *p)
		wake_oom_reaper(p);
	}
	task_unlock(p);

	if (__ratelimit(&reaper_rs) && p->signal->oom_score_adj == 0) {
		show_mem(SHOW_MEM_FILTER_NODES, NULL);
		show_mem_call_notifiers();
		if (sysctl_oom_dump_tasks)
			dump_tasks(&oc);
	}

	put_task_struct(p);
}