From: Michal Hocko <mhocko@kernel.org>
To: David Rientjes <rientjes@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Vlastimil Babka <vbabka@suse.cz>,
Johannes Weiner <hannes@cmpxchg.org>,
Mel Gorman <mgorman@suse.de>,
linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [patch] mm, oom: header nodemask is NULL when cpusets are disabled
Date: Tue, 24 Jan 2017 11:12:55 +0100 [thread overview]
Message-ID: <20170124101255.GC6867@dhcp22.suse.cz> (raw)
In-Reply-To: <alpine.DEB.2.10.1701191454470.2381@chino.kir.corp.google.com>
On Thu 19-01-17 14:57:36, David Rientjes wrote:
> Commit 82e7d3abec86 ("oom: print nodemask in the oom report") implicitly
> sets the allocation nodemask to cpuset_current_mems_allowed when there is
> no effective mempolicy. cpuset_current_mems_allowed is only effective
> when cpusets are enabled, which is also printed by dump_header(), so
> setting the nodemask to cpuset_current_mems_allowed is redundant and
> prevents debugging issues where ac->nodemask is not set properly in the
> page allocator.
>
> This provides better debugging output since
> cpuset_print_current_mems_allowed() is already provided.
>
> Suggested-by: Vlastimil Babka <vbabka@suse.cz>
> Signed-off-by: David Rientjes <rientjes@google.com>
With the removed \n addressed in the follow up fix
Acked-by: Michal Hocko <mhocko@suse.com>
> ---
> mm/oom_kill.c | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/mm/oom_kill.c b/mm/oom_kill.c
> --- a/mm/oom_kill.c
> +++ b/mm/oom_kill.c
> @@ -403,12 +403,14 @@ static void dump_tasks(struct mem_cgroup *memcg, const nodemask_t *nodemask)
>
> static void dump_header(struct oom_control *oc, struct task_struct *p)
> {
> - nodemask_t *nm = (oc->nodemask) ? oc->nodemask : &cpuset_current_mems_allowed;
> -
> - pr_warn("%s invoked oom-killer: gfp_mask=%#x(%pGg), nodemask=%*pbl, order=%d, oom_score_adj=%hd\n",
> - current->comm, oc->gfp_mask, &oc->gfp_mask,
> - nodemask_pr_args(nm), oc->order,
> - current->signal->oom_score_adj);
> + pr_warn("%s invoked oom-killer: gfp_mask=%#x(%pGg), nodemask=",
> + current->comm, oc->gfp_mask, &oc->gfp_mask);
> + if (oc->nodemask)
> + pr_cont("%*pbl", nodemask_pr_args(oc->nodemask));
> + else
> + pr_cont("(null)\n");
> + pr_cont(", order=%d, oom_score_adj=%hd\n",
> + oc->order, current->signal->oom_score_adj);
> if (!IS_ENABLED(CONFIG_COMPACTION) && oc->order)
> pr_warn("COMPACTION is disabled!!!\n");
>
> @@ -417,7 +419,7 @@ static void dump_header(struct oom_control *oc, struct task_struct *p)
> if (oc->memcg)
> mem_cgroup_print_oom_info(oc->memcg, p);
> else
> - show_mem(SHOW_MEM_FILTER_NODES, nm);
> + show_mem(SHOW_MEM_FILTER_NODES, oc->nodemask);
> if (sysctl_oom_dump_tasks)
> dump_tasks(oc->memcg, oc->nodemask);
> }
--
Michal Hocko
SUSE Labs
--
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>
WARNING: multiple messages have this Message-ID (diff)
From: Michal Hocko <mhocko@kernel.org>
To: David Rientjes <rientjes@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Vlastimil Babka <vbabka@suse.cz>,
Johannes Weiner <hannes@cmpxchg.org>,
Mel Gorman <mgorman@suse.de>,
linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [patch] mm, oom: header nodemask is NULL when cpusets are disabled
Date: Tue, 24 Jan 2017 11:12:55 +0100 [thread overview]
Message-ID: <20170124101255.GC6867@dhcp22.suse.cz> (raw)
In-Reply-To: <alpine.DEB.2.10.1701191454470.2381@chino.kir.corp.google.com>
On Thu 19-01-17 14:57:36, David Rientjes wrote:
> Commit 82e7d3abec86 ("oom: print nodemask in the oom report") implicitly
> sets the allocation nodemask to cpuset_current_mems_allowed when there is
> no effective mempolicy. cpuset_current_mems_allowed is only effective
> when cpusets are enabled, which is also printed by dump_header(), so
> setting the nodemask to cpuset_current_mems_allowed is redundant and
> prevents debugging issues where ac->nodemask is not set properly in the
> page allocator.
>
> This provides better debugging output since
> cpuset_print_current_mems_allowed() is already provided.
>
> Suggested-by: Vlastimil Babka <vbabka@suse.cz>
> Signed-off-by: David Rientjes <rientjes@google.com>
With the removed \n addressed in the follow up fix
Acked-by: Michal Hocko <mhocko@suse.com>
> ---
> mm/oom_kill.c | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/mm/oom_kill.c b/mm/oom_kill.c
> --- a/mm/oom_kill.c
> +++ b/mm/oom_kill.c
> @@ -403,12 +403,14 @@ static void dump_tasks(struct mem_cgroup *memcg, const nodemask_t *nodemask)
>
> static void dump_header(struct oom_control *oc, struct task_struct *p)
> {
> - nodemask_t *nm = (oc->nodemask) ? oc->nodemask : &cpuset_current_mems_allowed;
> -
> - pr_warn("%s invoked oom-killer: gfp_mask=%#x(%pGg), nodemask=%*pbl, order=%d, oom_score_adj=%hd\n",
> - current->comm, oc->gfp_mask, &oc->gfp_mask,
> - nodemask_pr_args(nm), oc->order,
> - current->signal->oom_score_adj);
> + pr_warn("%s invoked oom-killer: gfp_mask=%#x(%pGg), nodemask=",
> + current->comm, oc->gfp_mask, &oc->gfp_mask);
> + if (oc->nodemask)
> + pr_cont("%*pbl", nodemask_pr_args(oc->nodemask));
> + else
> + pr_cont("(null)\n");
> + pr_cont(", order=%d, oom_score_adj=%hd\n",
> + oc->order, current->signal->oom_score_adj);
> if (!IS_ENABLED(CONFIG_COMPACTION) && oc->order)
> pr_warn("COMPACTION is disabled!!!\n");
>
> @@ -417,7 +419,7 @@ static void dump_header(struct oom_control *oc, struct task_struct *p)
> if (oc->memcg)
> mem_cgroup_print_oom_info(oc->memcg, p);
> else
> - show_mem(SHOW_MEM_FILTER_NODES, nm);
> + show_mem(SHOW_MEM_FILTER_NODES, oc->nodemask);
> if (sysctl_oom_dump_tasks)
> dump_tasks(oc->memcg, oc->nodemask);
> }
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2017-01-24 10:12 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-18 21:51 [patch -mm] mm, page_alloc: warn_alloc nodemask is NULL when cpusets are disabled David Rientjes
2017-01-18 21:51 ` David Rientjes
2017-01-19 7:29 ` Vlastimil Babka
2017-01-19 7:29 ` Vlastimil Babka
2017-01-19 8:57 ` Michal Hocko
2017-01-19 8:57 ` Michal Hocko
2017-01-19 22:57 ` [patch] mm, oom: header " David Rientjes
2017-01-19 22:57 ` David Rientjes
2017-01-20 7:07 ` Hillf Danton
2017-01-20 7:07 ` Hillf Danton
2017-01-20 10:00 ` [patch -mm] mm, oom: header nodemask is NULL when cpusets are disabled fix David Rientjes
2017-01-20 10:00 ` David Rientjes
2017-01-20 9:00 ` [patch] mm, oom: header nodemask is NULL when cpusets are disabled Vlastimil Babka
2017-01-20 9:00 ` Vlastimil Babka
2017-01-20 10:02 ` David Rientjes
2017-01-20 10:02 ` David Rientjes
2017-01-24 10:12 ` Michal Hocko [this message]
2017-01-24 10:12 ` 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=20170124101255.GC6867@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=rientjes@google.com \
--cc=vbabka@suse.cz \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.