linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
To: ufo19890607@gmail.com
Cc: akpm@linux-foundation.org, mhocko@suse.com, rientjes@google.com,
	kirill.shutemov@linux.intel.com, aarcange@redhat.com,
	guro@fb.com, yang.s@alibaba-inc.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org,
	yuzhoujian <yuzhoujian@didichuxing.com>
Subject: Re: [PATCH v7 2/2] Refactor part of the oom report in dump_header
Date: Sun, 3 Jun 2018 23:45:15 +0900	[thread overview]
Message-ID: <abb05530-c259-1178-523a-4368e43f94cc@i-love.sakura.ne.jp> (raw)
In-Reply-To: <1527940734-35161-2-git-send-email-ufo19890607@gmail.com>

On 2018/06/02 20:58, yuzhoujian wrote:
> -void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, struct task_struct *p)
> +void mem_cgroup_print_oom_context(struct mem_cgroup *memcg, struct task_struct *p,
> +			enum oom_constraint constraint, nodemask_t *nodemask)
>  {
> -	struct mem_cgroup *iter;
> -	unsigned int i;
> +	static char origin_memcg_name[NAME_MAX], kill_memcg_name[NAME_MAX];
> +	struct cgroup *origin_cgrp, *kill_cgrp;
>  
>  	rcu_read_lock();
> -
> -	if (p) {
> -		pr_info("Task in ");
> -		pr_cont_cgroup_path(task_cgroup(p, memory_cgrp_id));
> -		pr_cont(" killed as a result of limit of ");
> -	} else {
> -		pr_info("Memory limit reached of cgroup ");
> +	if (memcg) {
> +		origin_cgrp = memcg->css.cgroup;
> +		cgroup_path(origin_cgrp, origin_memcg_name, NAME_MAX);
>  	}
> -
> -	pr_cont_cgroup_path(memcg->css.cgroup);
> -	pr_cont("\n");
> -
> +	kill_cgrp = task_cgroup(p, memory_cgrp_id);
> +	cgroup_path(kill_cgrp, kill_memcg_name, NAME_MAX);
> +
> +	if (p)
> +		pr_info("oom-kill:constraint=%s,nodemask=%*pbl,origin_memcg=%s,kill_memcg=%s,task=%s,pid=%5d,uid=%5d\n",
> +			oom_constraint_text[constraint], nodemask_pr_args(nodemask),
> +			strlen(origin_memcg_name) ? origin_memcg_name : "(null)",

Since origin_memcg_name is printed for both memcg OOM and !memcg OOM,
it is strange that origin_memcg_name is updated only when memcg != NULL.
Have you really tested !memcg OOM case?

  parent reply	other threads:[~2018-06-03 15:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-02 11:58 [PATCH v7 1/2] Add an array of const char and enum oom_constraint in memcontrol.h ufo19890607
2018-06-02 11:58 ` [PATCH v7 2/2] Refactor part of the oom report in dump_header ufo19890607
2018-06-03 12:49   ` Mike Rapoport
2018-06-04  1:58     ` 禹舟键
2018-06-04  2:41       ` 禹舟键
2018-06-04  4:58         ` Mike Rapoport
2018-06-04  6:25           ` 禹舟键
2018-06-08  9:53           ` 禹舟键
2018-06-10  5:12             ` Mike Rapoport
2018-06-11  7:07               ` Michal Hocko
2018-06-03 14:45   ` Tetsuo Handa [this message]
2018-06-04  6:52   ` Michal Hocko
2018-06-04  8:18     ` 禹舟键
2018-06-04  8:57       ` 禹舟键
2018-06-04  9:52         ` Michal Hocko
2018-06-04 12:13           ` 禹舟键
2018-06-04 12:17             ` Michal Hocko
2018-06-02 11:58 ` [PATCH v7 1/2] Add an array of const char and enum oom_constraint in memcontrol.h ufo19890607
2018-06-02 11:58 ` [PATCH v7 2/2] Refactor part of the oom report in dump_header ufo19890607
2018-06-04  6:48 ` [PATCH v7 1/2] Add an array of const char and enum oom_constraint in memcontrol.h Michal Hocko

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=abb05530-c259-1178-523a-4368e43f94cc@i-love.sakura.ne.jp \
    --to=penguin-kernel@i-love.sakura.ne.jp \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=guro@fb.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=rientjes@google.com \
    --cc=ufo19890607@gmail.com \
    --cc=yang.s@alibaba-inc.com \
    --cc=yuzhoujian@didichuxing.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