Subject: + mm-page_alloc-warn-for-non-blockable-__gfp_nofail-allocation-failure.patch added to -mm tree To: rientjes@xxxxxxxxxx,akpm@xxxxxxxxxxxxxxxxxxxx,mgorman@xxxxxxx,mhocko@xxxxxxx From: akpm@xxxxxxxxxxxxxxxxxxxx Date: Wed, 11 Dec 2013 15:59:22 -0800 The patch titled Subject: mm, page_alloc: warn for non-blockable __GFP_NOFAIL allocation failure has been added to the -mm tree. Its filename is mm-page_alloc-warn-for-non-blockable-__gfp_nofail-allocation-failure.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-page_alloc-warn-for-non-blockable-__gfp_nofail-allocation-failure.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-page_alloc-warn-for-non-blockable-__gfp_nofail-allocation-failure.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: David Rientjes <rientjes@xxxxxxxxxx> Subject: mm, page_alloc: warn for non-blockable __GFP_NOFAIL allocation failure __GFP_NOFAIL may return NULL when coupled with GFP_NOWAIT or GFP_ATOMIC. Luckily, nothing currently does such craziness. So instead of causing such allocations to loop (potentially forever), we maintain the current behavior and also warn about the new users of the deprecated flag. Suggested-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Signed-off-by: David Rientjes <rientjes@xxxxxxxxxx> Cc: Mel Gorman <mgorman@xxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/page_alloc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff -puN mm/page_alloc.c~mm-page_alloc-warn-for-non-blockable-__gfp_nofail-allocation-failure mm/page_alloc.c --- a/mm/page_alloc.c~mm-page_alloc-warn-for-non-blockable-__gfp_nofail-allocation-failure +++ a/mm/page_alloc.c @@ -2527,8 +2527,15 @@ rebalance: } /* Atomic allocations - we can't balance anything */ - if (!wait) + if (!wait) { + /* + * All existing users of the deprecated __GFP_NOFAIL are + * blockable, so warn of any new users that actually allow this + * type of allocation to fail. + */ + WARN_ON_ONCE(gfp_mask & __GFP_NOFAIL); goto nopage; + } /* Avoid recursion of direct reclaim */ if (current->flags & PF_MEMALLOC) _ Patches currently in -mm which might be from rientjes@xxxxxxxxxx are include-linux-hugetlbh-make-isolate_huge_page-an-inline.patch mm-memcg-do-not-declare-oom-from-__gfp_nofail-allocations.patch mm-memcg-fix-race-condition-between-memcg-teardown-and-swapin.patch mm-memcg-do-not-allow-task-about-to-oom-kill-to-bypass-the-limit.patch arch-x86-mm-sratc-skip-numa_no_node-while-parsing-slit.patch arch-x86-mm-sratc-skip-numa_no_node-while-parsing-slit-fix.patch mm-memcg-avoid-oom-notification-when-current-needs-access-to-memory-reserves.patch mm-mempolicy-remove-unneeded-functions-for-uma-configs.patch mm-show_mem-remove-show_mem_filter_page_count.patch introduce-for_each_thread-to-replace-the-buggy-while_each_thread.patch oom_kill-change-oom_killc-to-use-for_each_thread.patch oom_kill-has_intersects_mems_allowed-needs-rcu_read_lock.patch oom_kill-add-rcu_read_lock-into-find_lock_task_mm.patch mm-page_alloc-allow-__gfp_nofail-to-allocate-below-watermarks-after-reclaim.patch lib-show_memc-show-num_poisoned_pages-when-oom.patch memcg-oom-lock-mem_cgroup_print_oom_info.patch mm-page_alloc-warn-for-non-blockable-__gfp_nofail-allocation-failure.patch checkpatch-add-warning-of-future-__gfp_nofail-use.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html