Skip to content

mm/compaction: some fix for the range passed to pageblock_pfn_to_page()

Wei Yang linux-mm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 12 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2mm/compaction: check the range to pageblock_pfn_to_page() is within the zone firstmm/internal.h+3 -03 replies
2/2mm/compaction: fix the range to pageblock_pfn_to_page()mm/compaction.c+14 -233 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] mm/compaction: some fix for the range passed to pageblock_pfn_to_page()

During the code reading of isolate_migratepages_range(), first spot the range passed to pageblock_pfn_to_page() is different from that to isolate_migratepages_block().

This implies there is a chance that pageblock_pfn_to_page() thinks the range is in the same zone, but isolate_migratepages_block() will isolate range in two different zones. This is not what we expect.

Then I found pageblock_pfn_to_page() has an optimization if zone->contiguous, this means even the range is across two different zones, it will think the range is within the same zone.

So introduce two patches to fix it:

Patch 1: check the range belongs to the zone first Patch 2: pass the correct range to pageblock_pfn_to_page()

Wei Yang (2):
mm/compaction: check the range to pageblock_pfn_to_page() is within
the zone first
mm/compaction: fix the range to pageblock_pfn_to_page()

 mm/compaction.c | 37 ++++++++++++++-----------------------
 mm/internal.h   |  3 +++
 2 files changed, 17 insertions(+), 23 deletions(-)
Signature · 1 line
2.34.1