Skip to contentSkip to conversation

mm-page_isolation-move-has_unmovable_pages-to-mm-page_isolationc.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message May 13, 2022

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm: page_isolation: move has_unmovable_pages() to mm/page_isolation.c
has been removed from the -mm tree. Its filename was
mm-page_isolation-move-has_unmovable_pages-to-mm-page_isolationc.patch

This patch was dropped because it was merged into the mm-stable branch\nof git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Zi Yan <[email protected]>
Subject: mm: page_isolation: move has_unmovable_pages() to mm/page_isolation.c

Patch series "Use pageblock_order for cma and alloc_contig_range alignment", v11.

This patchset tries to remove the MAX_ORDER-1 alignment requirement for CMA and alloc_contig_range(). It prepares for my upcoming changes to make MAX_ORDER adjustable at boot time[1].

The MAX_ORDER - 1 alignment requirement comes from that alloc_contig_range() isolates pageblocks to remove free memory from buddy allocator but isolating only a subset of pageblocks within a page spanning across multiple pageblocks causes free page accounting issues. Isolated page might not be put into the right free list, since the code assumes the migratetype of the first pageblock as the whole free page migratetype. This is based on the discussion at [2].

To remove the requirement, this patchset:
1. isolates pages at pageblock granularity instead of max(MAX_ORDER_NR_PAEGS, pageblock_nr_pages);
2. splits free pages across the specified range or migrates in-use pages across the specified range then splits the freed page to avoid free page accounting issues (it happens when multiple pageblocks within a single page have different migratetypes);
3. only checks unmovable pages within the range instead of MAX_ORDER - 1 aligned range during isolation to avoid alloc_contig_range() failure when pageblocks within a MAX_ORDER - 1 aligned range are allocated separately.
4. returns pages not in the range as it did before.

One optimization might come later:
1. make MIGRATE_ISOLATE a separate bit to be able to restore the original migratetypes when isolation fails in the middle of the range.

[1] https://lore.kernel.org/linux-mm/[email protected]/
[2] https://lore.kernel.org/linux-mm/[email protected]/

This patch (of 6):

has_unmovable_pages() is only used in mm/page_isolation.c. Move it from mm/page_alloc.c and make it static.

---

 include/linux/page-isolation.h |    2 
 mm/page_alloc.c                |  119 -------------------------------
 mm/page_isolation.c            |  119 +++++++++++++++++++++++++++++++
 3 files changed, 119 insertions(+), 121 deletions(-)
include/linux/page-isolation.h renamed from include/linux/page-isolation.h~mm-page_isolation-move-has_unmovable_pages-to-mm-page_isolationc +0 -2
@@ -33,8 +33,6 @@ static inline bool is_migrate_isolate(in
 #define MEMORY_OFFLINE	0x1
 #define REPORT_FAILURE	0x2
 
-struct page *has_unmovable_pages(struct zone *zone, struct page *page,
-				 int migratetype, int flags);
 void set_pageblock_migratetype(struct page *page, int migratetype);
 int move_freepages_block(struct zone *zone, struct page *page,
 				int migratetype, int *num_movable);
mm/page_alloc.c renamed from mm/page_alloc.c~mm-page_isolation-move-has_unmovable_pages-to-mm-page_isolationc +0 -119

125 lines not on this page · raw message

mm/page_isolation.c renamed from mm/page_isolation.c~mm-page_isolation-move-has_unmovable_pages-to-mm-page_isolationc +119 -0

125 lines not on this page · raw message

_

Patches currently in -mm which might be from [email protected] are