linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: 禹舟键 <ufo19890607@gmail.com>
Cc: akpm@linux-foundation.org, rientjes@google.com,
	kirill.shutemov@linux.intel.com, aarcange@redhat.com,
	penguin-kernel@i-love.sakura.ne.jp, guro@fb.com,
	yang.s@alibaba-inc.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org,
	Wind Yu <yuzhoujian@didichuxing.com>
Subject: Re: [PATCH v11 1/2] Refactor part of the oom report in dump_header
Date: Tue, 3 Jul 2018 13:03:35 +0200	[thread overview]
Message-ID: <20180703110335.GH16767@dhcp22.suse.cz> (raw)
In-Reply-To: <CAHCio2h1G5UDRv_veWbzRAMtM+NheyVfsghoC3G80BJgOtuW7g@mail.gmail.com>

On Tue 03-07-18 18:57:14, c|1e??e?(R) wrote:
> Hi Michal
> cpuset_print_current_mems_allowed is also invoked by
> warn_alloc(page_alloc.c). So, can I remove the current->comm output in
> the pr_info ?
> 
> diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
> index d8b12e0d39cd..09b8ef6186c6 100644
> --- a/kernel/cgroup/cpuset.c
> +++ b/kernel/cgroup/cpuset.c
> @@ -2666,9 +2666,9 @@ void cpuset_print_current_mems_allowed(void)
>         rcu_read_lock();
> 
>         cgrp = task_cs(current)->css.cgroup;
> -       pr_info("%s cpuset=", current->comm);
> +       pr_info(",cpuset=");
>         pr_cont_cgroup_name(cgrp);
> -       pr_cont(" mems_allowed=%*pbl\n",
> +       pr_cont(",mems_allowed=%*pbl",
>                 nodemask_pr_args(&current->mems_allowed));

Yes, I think so. Just jam the cpuset info to the allocation context
warning like this

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 1521100f1e63..6bc7d5d4007a 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3416,12 +3416,13 @@ void warn_alloc(gfp_t gfp_mask, nodemask_t *nodemask, const char *fmt, ...)
 	va_start(args, fmt);
 	vaf.fmt = fmt;
 	vaf.va = &args;
-	pr_warn("%s: %pV, mode:%#x(%pGg), nodemask=%*pbl\n",
+	pr_warn("%s: %pV, mode:%#x(%pGg), nodemask=%*pbl",
 			current->comm, &vaf, gfp_mask, &gfp_mask,
 			nodemask_pr_args(nodemask));
 	va_end(args);
 
 	cpuset_print_current_mems_allowed();
+	pr_cont("\n");
 
 	dump_stack();
 	warn_alloc_show_mem(gfp_mask, nodemask);
-- 
Michal Hocko
SUSE Labs

  reply	other threads:[~2018-07-03 11:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-30 16:38 [PATCH v11 1/2] Refactor part of the oom report in dump_header ufo19890607
2018-06-30 16:38 ` [PATCH v11 2/2] Add the missing information " ufo19890607
2018-07-02 10:22   ` Michal Hocko
2018-07-05  8:01   ` [lkp-robot] 3586e04c29: BUG:KASAN:user-memory-access_in_d kernel test robot
2018-07-02 10:17 ` [PATCH v11 1/2] Refactor part of the oom report in dump_header Michal Hocko
2018-07-03 10:57   ` 禹舟键
2018-07-03 11:03     ` Michal Hocko [this message]
2018-07-03 17:25 ` Andy Shevchenko
2018-07-04  2:25   ` 禹舟键
2018-07-04  8:17     ` Michal Hocko
2018-07-05 11:23       ` 禹舟键
2018-07-05 12:24         ` Andy Shevchenko
2018-07-04  8:47     ` Andy Shevchenko

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=20180703110335.GH16767@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --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=penguin-kernel@i-love.sakura.ne.jp \
    --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;
as well as URLs for NNTP newsgroup(s).