linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm, compaction: fast_find_migrateblock() should return pfn in the target zone
@ 2022-05-11  4:43 Rei Yamamoto
  2022-05-11  6:25 ` Miaohe Lin
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Rei Yamamoto @ 2022-05-11  4:43 UTC (permalink / raw)
  To: akpm
  Cc: mgorman, vvghjk1234, aquini, ddutile, linux-mm, linux-kernel,
	yamamoto.rei

Prevent returning a pfn outside the target zone in case that not
aligned with pageblock boundary.
Otherwise isolate_migratepages_block() would handle pages not in
the target zone.

Signed-off-by: Rei Yamamoto <yamamoto.rei@jp.fujitsu.com>
---
 mm/compaction.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mm/compaction.c b/mm/compaction.c
index fe915db6149b..de42b8e48758 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -1858,6 +1858,8 @@ static unsigned long fast_find_migrateblock(struct compact_control *cc)
 
 				update_fast_start_pfn(cc, free_pfn);
 				pfn = pageblock_start_pfn(free_pfn);
+				if (pfn < cc->zone->zone_start_pfn)
+					pfn = cc->zone->zone_start_pfn;
 				cc->fast_search_fail = 0;
 				found_block = true;
 				set_pageblock_skip(freepage);
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-05-16  3:03 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-11  4:43 [PATCH] mm, compaction: fast_find_migrateblock() should return pfn in the target zone Rei Yamamoto
2022-05-11  6:25 ` Miaohe Lin
2022-05-11  7:07   ` Rei Yamamoto
2022-05-11  9:26     ` Miaohe Lin
2022-05-12  1:47       ` Rei Yamamoto
2022-05-12  2:20         ` Andrew Morton
2022-05-12  2:27         ` Miaohe Lin
2022-05-12  4:27           ` Rei Yamamoto
2022-05-12 20:49             ` Andrew Morton
2022-05-13  4:11               ` Rei Yamamoto
2022-05-13 21:01                 ` Andrew Morton
2022-05-16  2:41                   ` Rei Yamamoto
2022-05-12  9:04 ` Mel Gorman
2022-05-13  7:54 ` Oscar Salvador

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).