On 2016/3/29 17:52, Vlastimil Babka wrote:
The code in this functions seems to come from 099730d67417d ("mm, hugetlb: use memory policy when available") by Dave Hansen (adding to CC), which was indeed merged in 4.4-rc1.
However, alloc_pages_node() is only called in the block guarded by:
if (!IS_ENABLED(CONFIG_NUMA) || !vma) {
The rather weird "!IS_ENABLED(CONFIG_NUMA)" part comes from immediate followup commit e0ec90ee7e6f ("mm, hugetlbfs: optimize when NUMA=n")
So I doubt the code path here can actually happen. But it's fragile and confusing nevertheless.
Hi Vlastimil
__alloc_buddy_huge_page(h, NULL, addr, nid); // so the vma is NULL