Re: [patch for-4.20] Revert "mm, thp: consolidate THP gfp handling into alloc_hugepage_direct_gfpmask"
From: Vlastimil Babka
Date: Fri Dec 07 2018 - 09:41:55 EST
On 12/6/18 11:00 PM, David Rientjes wrote:
> This reverts commit 89c83fb539f95491be80cdd5158e6f0ce329e317.
>
> There are a couple of issues with 89c83fb539f9 independent of its partial
> revert in 2f0799a0ffc0 ("mm, thp: restore node-local hugepage
> allocations"):
>
> Firstly, the interaction between alloc_hugepage_direct_gfpmask() and
> alloc_pages_vma() is racy wrt __GFP_THISNODE and MPOL_BIND.
> alloc_hugepage_direct_gfpmask() makes sure not to set __GFP_THISNODE for
> an MPOL_BIND policy but the policy used in alloc_pages_vma() may not be
> the same for shared vma policies, triggering the WARN_ON_ONCE() in
> policy_node().
AFAICS 2f0799a0ffc0 removed the policy check in
alloc_hugepage_direct_gfpmask() comlpetely, so it's not racy and the
warning will always trigger for a MPOL_BIND policy right now?