summaryrefslogtreecommitdiffstats
path: root/mm/mempolicy.c
diff options
context:
space:
mode:
authorKefeng Wang <wangkefeng.wang@huawei.com>2024-05-15 09:07:06 +0200
committerAndrew Morton <akpm@linux-foundation.org>2024-07-04 04:29:52 +0200
commita19621ed4e0ac9e1d296d07dc8ff8c27d5c03b43 (patch)
tree81efcee71986373a4c6171e820cc19360cd2d49e /mm/mempolicy.c
parentmm/hugetlb: drop node_alloc_noretry from alloc_fresh_hugetlb_folio (diff)
downloadlinux-a19621ed4e0ac9e1d296d07dc8ff8c27d5c03b43.tar.xz
linux-a19621ed4e0ac9e1d296d07dc8ff8c27d5c03b43.zip
mm: add folio_alloc_mpol()
Patch series "mm: convert to folio_alloc_mpol()". This patch (of 4): This adds a new folio_alloc_mpol() like folio_alloc() but allocate folio according to NUMA mempolicy. Link: https://lkml.kernel.org/r/20240515070709.78529-1-wangkefeng.wang@huawei.com Link: https://lkml.kernel.org/r/20240515070709.78529-2-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Cc: Hugh Dickins <hughd@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/mempolicy.c')
-rw-r--r--mm/mempolicy.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index aec756ae5637..69c431ef15d5 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2277,6 +2277,13 @@ struct page *alloc_pages_mpol_noprof(gfp_t gfp, unsigned int order,
return page;
}
+struct folio *folio_alloc_mpol_noprof(gfp_t gfp, unsigned int order,
+ struct mempolicy *pol, pgoff_t ilx, int nid)
+{
+ return page_rmappable_folio(alloc_pages_mpol_noprof(gfp | __GFP_COMP,
+ order, pol, ilx, nid));
+}
+
/**
* vma_alloc_folio - Allocate a folio for a VMA.
* @gfp: GFP flags.