The patch titled Subject: sparc: clarify __GFP_NOFAIL allocation has been added to the -mm tree. Its filename is sparc-clarify-__gfp_nofail-allocation.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/sparc-clarify-__gfp_nofail-allocation.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/sparc-clarify-__gfp_nofail-allocation.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: Michal Hocko <mhocko@xxxxxxx> Subject: sparc: clarify __GFP_NOFAIL allocation 920c3ed74134 ([SPARC64]: Add basic infrastructure for MD add/remove notification.) has added __GFP_NOFAIL for the allocation request but it hasn't mentioned why is this strict requirement really needed. The code was handling an allocation failure and propagated it properly up the callchain so it is not clear why it is needed. Dave has clarified the intention when I tried to remove the flag as not being necessary: : It is a serious failure. : : If we miss an MDESC update due to this allocation failure, the update : is not an event which gets retransmitted so we will lose the updated : machine description forever. : : We really need this allocation to succeed. So add a comment to clarify the nofail flag and get rid of the failure check because __GFP_NOFAIL allocation doesn't fail. Signed-off-by: Michal Hocko <mhocko@xxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Dave Chinner <david@xxxxxxxxxxxxx> Cc: "Theodore Ts'o" <tytso@xxxxxxx> Cc: Mel Gorman <mgorman@xxxxxxx> Cc: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx> Cc: "David S. Miller" <davem@xxxxxxxxxxxxx> Cc: Vipul Pandya <vipul@xxxxxxxxxxx> Cc: Jan Kara <jack@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- arch/sparc/kernel/mdesc.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff -puN arch/sparc/kernel/mdesc.c~sparc-clarify-__gfp_nofail-allocation arch/sparc/kernel/mdesc.c --- a/arch/sparc/kernel/mdesc.c~sparc-clarify-__gfp_nofail-allocation +++ a/arch/sparc/kernel/mdesc.c @@ -130,26 +130,26 @@ static struct mdesc_mem_ops memblock_mde static struct mdesc_handle *mdesc_kmalloc(unsigned int mdesc_size) { unsigned int handle_size; + struct mdesc_handle *hp; + unsigned long addr; void *base; handle_size = (sizeof(struct mdesc_handle) - sizeof(struct mdesc_hdr) + mdesc_size); + /* + * Allocation has to succeed because mdesc update would be missed + * and such events are not retransmitted. + */ base = kmalloc(handle_size + 15, GFP_KERNEL | __GFP_NOFAIL); - if (base) { - struct mdesc_handle *hp; - unsigned long addr; + addr = (unsigned long)base; + addr = (addr + 15UL) & ~15UL; + hp = (struct mdesc_handle *) addr; - addr = (unsigned long)base; - addr = (addr + 15UL) & ~15UL; - hp = (struct mdesc_handle *) addr; + mdesc_handle_init(hp, handle_size, base); - mdesc_handle_init(hp, handle_size, base); - return hp; - } - - return NULL; + return hp; } static void mdesc_kfree(struct mdesc_handle *hp) _ Patches currently in -mm which might be from mhocko@xxxxxxx are origin.patch mm-oom-do-not-fail-__gfp_nofail-allocation-if-oom-killer-is-disbaled.patch mm-memcontrol-update-copyright-notice.patch mm-cma-release-trigger-fixpatch.patch mm-hide-per-cpu-lists-in-output-of-show_mem.patch mm-completely-remove-dumping-per-cpu-lists-from-show_mem.patch mm-refactor-do_wp_page-extract-the-reuse-case.patch mm-refactor-do_wp_page-rewrite-the-unlock-flow.patch mm-refactor-do_wp_page-extract-the-page-copy-flow.patch mm-refactor-do_wp_page-handling-of-shared-vma-into-a-function.patch mm-vmscan-fix-the-page-state-calculation-in-too_many_isolated.patch mm-page_isolation-check-pfn-validity-before-access.patch mm-support-madvisemadv_free.patch mm-dont-split-thp-page-when-syscall-is-called.patch mm-dont-split-thp-page-when-syscall-is-called-fix-2.patch fork-report-pid-reservation-failure-properly.patch mm-clarify-__gfp_nofail-deprecation-status.patch jbd2-revert-must-not-fail-allocation-loops-back-to-gfp_nofail.patch sparc-clarify-__gfp_nofail-allocation.patch cxgb4-drop-__gfp_nofail-allocation.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