From: Vlastimil Babka <vbabka@suse.cz>
To: David Rientjes <rientjes@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
Michal Hocko <mhocko@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
Mel Gorman <mgorman@suse.de>,
linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [patch -mm] mm, page_alloc: warn_alloc nodemask is NULL when cpusets are disabled
Date: Thu, 19 Jan 2017 08:29:45 +0100 [thread overview]
Message-ID: <279f10c2-3eaa-c641-094f-3070db67d84f@suse.cz> (raw)
In-Reply-To: <alpine.DEB.2.10.1701181347320.142399@chino.kir.corp.google.com>
On 01/18/2017 10:51 PM, David Rientjes wrote:
> The patch "mm, page_alloc: warn_alloc print nodemask" 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 warn_alloc(), 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.
>
> Signed-off-by: David Rientjes <rientjes@google.com>
Yes, with my current cpuset vs mempolicy debugging experience, this is
more useful (except how both nodemask and mems_allowed can change under
us, so what we print here is not necessarily the same that what
get_page_from_freelist() has seen, but that's another thing...).
But I would suggest you change the oom killer's dump_header() the same
way than warn_alloc().
Thanks,
Vlastimil
> ---
> mm/page_alloc.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -3037,7 +3037,6 @@ void warn_alloc(gfp_t gfp_mask, nodemask_t *nodemask, const char *fmt, ...)
> va_list args;
> static DEFINE_RATELIMIT_STATE(nopage_rs, DEFAULT_RATELIMIT_INTERVAL,
> DEFAULT_RATELIMIT_BURST);
> - nodemask_t *nm = (nodemask) ? nodemask : &cpuset_current_mems_allowed;
>
> if ((gfp_mask & __GFP_NOWARN) || !__ratelimit(&nopage_rs) ||
> debug_guardpage_minorder() > 0)
> @@ -3051,11 +3050,16 @@ void warn_alloc(gfp_t gfp_mask, nodemask_t *nodemask, const char *fmt, ...)
> pr_cont("%pV", &vaf);
> va_end(args);
>
> - pr_cont(", mode:%#x(%pGg), nodemask=%*pbl\n", gfp_mask, &gfp_mask, nodemask_pr_args(nm));
> + pr_cont(", mode:%#x(%pGg), nodemask=", gfp_mask, &gfp_mask);
> + if (nodemask)
> + pr_cont("%*pbl\n", nodemask_pr_args(nodemask));
> + else
> + pr_cont("(null)\n");
> +
> cpuset_print_current_mems_allowed();
>
> dump_stack();
> - warn_alloc_show_mem(gfp_mask, nm);
> + warn_alloc_show_mem(gfp_mask, nodemask);
> }
>
> static inline struct page *
>
--
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:[~2017-01-19 7:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-18 21:51 David Rientjes
2017-01-19 7:29 ` Vlastimil Babka [this message]
2017-01-19 8:57 ` Michal Hocko
2017-01-19 22:57 ` [patch] mm, oom: header " David Rientjes
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 9:00 ` [patch] mm, oom: header nodemask is NULL when cpusets are disabled Vlastimil Babka
2017-01-20 10:02 ` David Rientjes
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=279f10c2-3eaa-c641-094f-3070db67d84f@suse.cz \
--to=vbabka@suse.cz \
--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=mhocko@kernel.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