The patch titled Subject: mm, hugetlbfs: Fix new warning in fault-time huge page allocation has been added to the -mm tree. Its filename is mm-hugetlb-use-memory-policy-when-available-fix.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-hugetlb-use-memory-policy-when-available-fix.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-hugetlb-use-memory-policy-when-available-fix.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: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx> Subject: mm, hugetlbfs: Fix new warning in fault-time huge page allocation Kirill reported that he hit: >> + if (vma || addr) { >> + WARN_ON_ONCE(!addr || addr == -1); > > Trinity triggered the WARN for me: This was just a dumb mistake. I put the WARN_ON() in and planned to have addr=0 mean "use nid". But, I realized pretty quickly that addr=0 _is_ a valid place to fault. So I made it addr=-1 in __alloc_buddy_huge_page_no_mpol(), but I did not fix up the WARN_ON(). So hitting the warning in this case was harmless. But, fix up the warning condition. Signed-off-by: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx> Cc: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx> Cc: Naoya Horiguchi <n-horiguchi@xxxxxxxxxxxxx> Cc: Mike Kravetz <mike.kravetz@xxxxxxxxxx> Cc: Hillf Danton <hillf.zj@xxxxxxxxxxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/hugetlb.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff -puN mm/hugetlb.c~mm-hugetlb-use-memory-policy-when-available-fix mm/hugetlb.c --- a/mm/hugetlb.c~mm-hugetlb-use-memory-policy-when-available-fix +++ a/mm/hugetlb.c @@ -1514,8 +1514,13 @@ static struct page *__alloc_buddy_huge_p if (hstate_is_gigantic(h)) return NULL; - if (vma || addr) { - WARN_ON_ONCE(!addr || addr == -1); + /* + * Make sure that anyone specifying 'nid' is not also specifying a VMA. + * This makes sure the caller is picking _one_ of the modes with which + * we can call this function, not both. + */ + if (vma || (addr != -1)) { + WARN_ON_ONCE(addr == -1); WARN_ON_ONCE(nid != NUMA_NO_NODE); } /* _ Patches currently in -mm which might be from dave.hansen@xxxxxxxxxxxxxxx are inotify-hide-internal-kernel-bits-from-fdinfo.patch inotify-actually-check-for-invalid-bits-in-sys_inotify_add_watch.patch inotify-actually-check-for-invalid-bits-in-sys_inotify_add_watch-v2.patch mm-hugetlb-use-memory-policy-when-available.patch mm-hugetlb-use-memory-policy-when-available-fix.patch mm-hugetlbfs-optimize-when-numa=n.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