On 09/09/2016 06:03 AM, Li Zhong wrote:
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index a2214c6..d624ff3 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3448,6 +3448,12 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
if (page)
goto got_pg;
+ if (ac->nodemask && nodes_empty(*ac->nodemask)) {
+ pr_warn("nodemask is empty\n");
+ gfp_mask &= ~__GFP_NOWARN;
+ goto nopage;
+ }
+
Wouldn't it be better to do
if (WARN_ON(ac->nodemask && nodes_empty(*ac->nodemask)) {
...
so we can identify the misbehaving call site?
I think with __GFP_NOWARN cleared, we could know the call site from warn_alloc_failed().
And the message “nodemask is empty” makes the error obvious without going to the source.
Yes, that was my suggestion. It uses the generic warn_alloc_failed() this way.
With a WARN_ON we would either have to "return NULL" (and get only the WARN_ON
without the extra warn_alloc_failed() stuff) or "goto nopage" and thus get two
backtraces. But this should be really rare occurence, so I don't have a
particularly strong preference.
Anyway, since I suggested it in the first place:
Acked-by: Vlastimil Babka <vbabka@xxxxxxx>
Thanks, Zhong
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>