The patch titled Subject: mm/memplicy: add page allocation function for MPOL_PREFERRED_MANY policy has been removed from the -mm tree. Its filename was mm-memplicy-add-page-allocation-function-for-mpol_preferred_many-policy.patch This patch was dropped because an updated version will be merged ------------------------------------------------------ From: Feng Tang <feng.tang@xxxxxxxxx> Subject: mm/memplicy: add page allocation function for MPOL_PREFERRED_MANY policy The semantics of MPOL_PREFERRED_MANY is similar to MPOL_PREFERRED, that it will first try to allocate memory from the preferred node(s), and fallback to all nodes in system when first try fails. Add a dedicated function for it just like 'interleave' policy. Link: https://lore.kernel.org/r/20200630212517.308045-9-ben.widawsky@xxxxxxxxx Link: https://lkml.kernel.org/r/1626077374-81682-3-git-send-email-feng.tang@xxxxxxxxx Signed-off-by: Feng Tang <feng.tang@xxxxxxxxx> Signed-off-by: Ben Widawsky <ben.widawsky@xxxxxxxxx> Co-developed-by: Ben Widawsky <ben.widawsky@xxxxxxxxx> Suggested-by: Michal Hocko <mhocko@xxxxxxxx> Cc: Andi Kleen <ak@xxxxxxxxxxxxxxx> Cc: Andrea Arcangeli <aarcange@xxxxxxxxxx> Cc: Dan Williams <dan.j.williams@xxxxxxxxx> Cc: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Cc: Huang Ying <ying.huang@xxxxxxxxx> Cc: Mel Gorman <mgorman@xxxxxxxxxxxxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxxxx> Cc: Mike Kravetz <mike.kravetz@xxxxxxxxxx> Cc: Randy Dunlap <rdunlap@xxxxxxxxxxxxx> Cc: Vlastimil Babka <vbabka@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/mempolicy.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) --- a/mm/mempolicy.c~mm-memplicy-add-page-allocation-function-for-mpol_preferred_many-policy +++ a/mm/mempolicy.c @@ -2153,6 +2153,25 @@ static struct page *alloc_page_interleav return page; } +static struct page *alloc_page_preferred_many(gfp_t gfp, unsigned int order, + struct mempolicy *pol) +{ + struct page *page; + + /* + * This is a two pass approach. The first pass will only try the + * preferred nodes but skip the direct reclaim and allow the + * allocation to fail, while the second pass will try all the + * nodes in system. + */ + page = __alloc_pages(((gfp | __GFP_NOWARN) & ~__GFP_DIRECT_RECLAIM), + order, first_node(pol->nodes), &pol->nodes); + if (!page) + page = __alloc_pages(gfp, order, numa_node_id(), NULL); + + return page; +} + /** * alloc_pages_vma - Allocate a page for a VMA. * @gfp: GFP flags. _ Patches currently in -mm which might be from feng.tang@xxxxxxxxx are mm-hugetlb-add-support-for-mempolicy-mpol_preferred_many-fix-2.patch mm-mempolicy-unify-the-create-func-for-bind-interleave-prefer-many-policies.patch