mm, page_alloc: warn_alloc nodemask is NULL when cpusets are disabled
Subsystems (2)
[email protected]
maintainerPATCH 134/142 mm, page_alloc: warn_alloc nodemask is NULL when cpusets are disabled
From: David Rientjes <[email protected]>
Subject: 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.
Signed-off-by David Rientjes <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Mel Gorman <[email protected]>
Cc Vlastimil Babka <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
mm/page_alloc.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
mm/page_alloc.c renamed from mm/page_alloc.c~mm-page_alloc-warn_alloc-nodemask-is-null-when-cpusets-are-disabled +7 -3
@@ -3034,7 +3034,6 @@ void warn_alloc(gfp_t gfp_mask, nodemaskva_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 )
@@ -3048,11 +3047,16 @@ void warn_alloc(gfp_t gfp_mask, nodemaskpr_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 *
_