summaryrefslogtreecommitdiff
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorZi Yan <ziy@nvidia.com>2022-05-12 20:22:58 -0700
committerAndrew Morton <akpm@linux-foundation.org>2022-05-13 07:20:13 -0700
commit6e263fff1de48fcd97b680b54cd8d1695fc3c776 (patch)
tree393bfa41a800b63161c526772acebd12835d688b /mm/page_alloc.c
parentb2c9e2fbba32539626522b6aed30d1dde7b7e971 (diff)
downloadlwn-6e263fff1de48fcd97b680b54cd8d1695fc3c776.tar.gz
lwn-6e263fff1de48fcd97b680b54cd8d1695fc3c776.zip
mm: page_isolation: enable arbitrary range page isolation.
Now start_isolate_page_range() is ready to handle arbitrary range isolation, so move the alignment check/adjustment into the function body. Do the same for its counterpart undo_isolate_page_range(). alloc_contig_range(), its caller, can pass an arbitrary range instead of a MAX_ORDER_NR_PAGES aligned one. Link: https://lkml.kernel.org/r/20220425143118.2850746-5-zi.yan@sent.com Signed-off-by: Zi Yan <ziy@nvidia.com> Cc: Christophe Leroy <christophe.leroy@csgroup.eu> Cc: David Hildenbrand <david@redhat.com> Cc: Eric Ren <renzhengeek@gmail.com> Cc: kernel test robot <lkp@intel.com> Cc: Mel Gorman <mgorman@techsingularity.net> Cc: Mike Rapoport <rppt@linux.ibm.com> Cc: Minchan Kim <minchan@kernel.org> Cc: Oscar Salvador <osalvador@suse.de> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 0c7252ed14a0..3d7de8a96143 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -8956,16 +8956,6 @@ void *__init alloc_large_system_hash(const char *tablename,
}
#ifdef CONFIG_CONTIG_ALLOC
-static unsigned long pfn_max_align_down(unsigned long pfn)
-{
- return ALIGN_DOWN(pfn, MAX_ORDER_NR_PAGES);
-}
-
-static unsigned long pfn_max_align_up(unsigned long pfn)
-{
- return ALIGN(pfn, MAX_ORDER_NR_PAGES);
-}
-
#if defined(CONFIG_DYNAMIC_DEBUG) || \
(defined(CONFIG_DYNAMIC_DEBUG_CORE) && defined(DYNAMIC_DEBUG_MODULE))
/* Usage: See admin-guide/dynamic-debug-howto.rst */
@@ -9107,8 +9097,7 @@ int alloc_contig_range(unsigned long start, unsigned long end,
* put back to page allocator so that buddy can use them.
*/
- ret = start_isolate_page_range(pfn_max_align_down(start),
- pfn_max_align_up(end), migratetype, 0, gfp_mask);
+ ret = start_isolate_page_range(start, end, migratetype, 0, gfp_mask);
if (ret)
goto done;
@@ -9189,8 +9178,7 @@ int alloc_contig_range(unsigned long start, unsigned long end,
free_contig_range(end, outer_end - end);
done:
- undo_isolate_page_range(pfn_max_align_down(start),
- pfn_max_align_up(end), migratetype);
+ undo_isolate_page_range(start, end, migratetype);
return ret;
}
EXPORT_SYMBOL(alloc_contig_range);