diff options
author | David Rientjes <rientjes@google.com> | 2017-02-22 18:46:28 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-02-22 19:41:30 -0500 |
commit | 685dbf6f5a643c4bdb9323ee3544ec652505d2ea (patch) | |
tree | 2d4d5853126589958b4632b71041822478b9ab4f /mm/page_alloc.c | |
parent | 6c18ba7a18997dadbf7ee912e15677ad2c9993e5 (diff) |
mm, page_alloc: warn_alloc nodemask is NULL when cpusets are disabled
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.
Link: http://lkml.kernel.org/r/alpine.DEB.2.10.1701181347320.142399@chino.kir.corp.google.com
Signed-off-by: David Rientjes <rientjes@google.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index a179607de26f..c21b33668133 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -3034,7 +3034,6 @@ void warn_alloc(gfp_t gfp_mask, nodemask_t *nodemask, const char *fmt, ...) | |||
3034 | va_list args; | 3034 | va_list args; |
3035 | static DEFINE_RATELIMIT_STATE(nopage_rs, DEFAULT_RATELIMIT_INTERVAL, | 3035 | static DEFINE_RATELIMIT_STATE(nopage_rs, DEFAULT_RATELIMIT_INTERVAL, |
3036 | DEFAULT_RATELIMIT_BURST); | 3036 | DEFAULT_RATELIMIT_BURST); |
3037 | nodemask_t *nm = (nodemask) ? nodemask : &cpuset_current_mems_allowed; | ||
3038 | 3037 | ||
3039 | if ((gfp_mask & __GFP_NOWARN) || !__ratelimit(&nopage_rs) || | 3038 | if ((gfp_mask & __GFP_NOWARN) || !__ratelimit(&nopage_rs) || |
3040 | debug_guardpage_minorder() > 0) | 3039 | debug_guardpage_minorder() > 0) |
@@ -3048,11 +3047,16 @@ void warn_alloc(gfp_t gfp_mask, nodemask_t *nodemask, const char *fmt, ...) | |||
3048 | pr_cont("%pV", &vaf); | 3047 | pr_cont("%pV", &vaf); |
3049 | va_end(args); | 3048 | va_end(args); |
3050 | 3049 | ||
3051 | pr_cont(", mode:%#x(%pGg), nodemask=%*pbl\n", gfp_mask, &gfp_mask, nodemask_pr_args(nm)); | 3050 | pr_cont(", mode:%#x(%pGg), nodemask=", gfp_mask, &gfp_mask); |
3051 | if (nodemask) | ||
3052 | pr_cont("%*pbl\n", nodemask_pr_args(nodemask)); | ||
3053 | else | ||
3054 | pr_cont("(null)\n"); | ||
3055 | |||
3052 | cpuset_print_current_mems_allowed(); | 3056 | cpuset_print_current_mems_allowed(); |
3053 | 3057 | ||
3054 | dump_stack(); | 3058 | dump_stack(); |
3055 | warn_alloc_show_mem(gfp_mask, nm); | 3059 | warn_alloc_show_mem(gfp_mask, nodemask); |
3056 | } | 3060 | } |
3057 | 3061 | ||
3058 | static inline struct page * | 3062 | static inline struct page * |