From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: David Rientjes <rientjes@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
linux-mm@kvack.org
Subject: Re: [patch] mm, oom: replace some information in tasklist dump
Date: Fri, 22 Jun 2012 18:54:06 -0400 [thread overview]
Message-ID: <CAHGf_=p4SS7qA_eRpBF0PawyUa8DpYncL0LS-=B4tHFaDUKV-w@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1206221444370.23486@chino.kir.corp.google.com>
On Fri, Jun 22, 2012 at 5:45 PM, David Rientjes <rientjes@google.com> wrote:
> The number of ptes and swap entries are used in the oom killer's badness
> heuristic, so they should be shown in the tasklist dump.
>
> This patch adds those fields and replaces cpu and oom_adj values that are
> currently emitted. Cpu isn't interesting and oom_adj is deprecated and
> will be removed later this year, the same information is already
> displayed as oom_score_adj which is used internally.
>
> At the same time, make the documentation a little more clear to state
> this information is helpful to determine why the oom killer chose the
> task it did to kill.
>
> Signed-off-by: David Rientjes <rientjes@google.com>
> ---
> Documentation/sysctl/vm.txt | 7 ++++---
> mm/oom_kill.c | 11 ++++++-----
> 2 files changed, 10 insertions(+), 8 deletions(-)
>
> diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt
> --- a/Documentation/sysctl/vm.txt
> +++ b/Documentation/sysctl/vm.txt
> @@ -502,9 +502,10 @@ oom_dump_tasks
>
> Enables a system-wide task dump (excluding kernel threads) to be
> produced when the kernel performs an OOM-killing and includes such
> -information as pid, uid, tgid, vm size, rss, cpu, oom_adj score, and
> -name. This is helpful to determine why the OOM killer was invoked
> -and to identify the rogue task that caused it.
> +information as pid, uid, tgid, vm size, rss, nr_ptes, swapents,
> +oom_score_adj score, and name. This is helpful to determine why the
> +OOM killer was invoked, to identify the rogue task that caused it,
> +and to determine why the OOM killer chose the task it did to kill.
>
> If this is set to zero, this information is suppressed. On very
> large systems with thousands of tasks it may not be feasible to dump
> diff --git a/mm/oom_kill.c b/mm/oom_kill.c
> --- a/mm/oom_kill.c
> +++ b/mm/oom_kill.c
> @@ -371,8 +371,8 @@ static struct task_struct *select_bad_process(unsigned int *ppoints,
> * Dumps the current memory state of all eligible tasks. Tasks not in the same
> * memcg, not in the same cpuset, or bound to a disjoint set of mempolicy nodes
> * are not shown.
> - * State information includes task's pid, uid, tgid, vm size, rss, cpu, oom_adj
> - * value, oom_score_adj value, and name.
> + * State information includes task's pid, uid, tgid, vm size, rss, nr_ptes,
> + * swapents, oom_score_adj value, and name.
> *
> * Call with tasklist_lock read-locked.
> */
> @@ -381,7 +381,7 @@ static void dump_tasks(const struct mem_cgroup *memcg, const nodemask_t *nodemas
> struct task_struct *p;
> struct task_struct *task;
>
> - pr_info("[ pid ] uid tgid total_vm rss cpu oom_adj oom_score_adj name\n");
> + pr_info("[ pid ] uid tgid total_vm rss nr_ptes swapents oom_score_adj name\n");
> for_each_process(p) {
> if (oom_unkillable_task(p, memcg, nodemask))
> continue;
> @@ -396,10 +396,11 @@ static void dump_tasks(const struct mem_cgroup *memcg, const nodemask_t *nodemas
> continue;
> }
>
> - pr_info("[%5d] %5d %5d %8lu %8lu %3u %3d %5d %s\n",
> + pr_info("[%5d] %5d %5d %8lu %8lu %7lu %8lu %5d %s\n",
> task->pid, from_kuid(&init_user_ns, task_uid(task)),
> task->tgid, task->mm->total_vm, get_mm_rss(task->mm),
> - task_cpu(task), task->signal->oom_adj,
> + task->mm->nr_ptes,
nr_ptes should be folded into rss. it's "resident".
btw, /proc rss info should be fixed too.
> + get_mm_counter(task->mm, MM_SWAPENTS),
> task->signal->oom_score_adj, task->comm);
> task_unlock(task);
> }
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org. For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2012-06-22 22:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-22 21:45 David Rientjes
2012-06-22 22:54 ` KOSAKI Motohiro [this message]
2012-06-22 23:10 ` David Rientjes
2012-06-22 23:12 ` KOSAKI Motohiro
2012-06-22 23:36 ` David Rientjes
2012-06-23 0:19 ` KOSAKI Motohiro
2012-06-24 20:43 ` David Rientjes
2012-06-25 7:37 ` KOSAKI Motohiro
2012-06-25 9:16 ` David Rientjes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAHGf_=p4SS7qA_eRpBF0PawyUa8DpYncL0LS-=B4tHFaDUKV-w@mail.gmail.com' \
--to=kosaki.motohiro@jp.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-mm@kvack.org \
--cc=rientjes@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox