Assorted compaction cleanups and optimizations
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest5 patches 3 repliesIn review
- v16 patches 18 repliesSuperseded
Changes in v2 from the cover letter
- dropped Patch 6 as adjusting to Joonsoo's objection would be too complicated and the results didn't justify it
- don't check for compound order > 0 in patches 4 and 5 as suggested by Michal Nazarewicz. Negative values are handled by converting to unsinged int, the pfn calculations work fine with 0 and it's unlikely to see 0 due to a race when we just checked PageCompound().
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | mm, compaction: more robust check for scanners meetingmm/ | +14 | 0 replies | |
| 2/5 | mm, compaction: simplify handling restart position in free pages scannermm/ | +20 | 1 reply | |
| 3/5 | mm, compaction: encapsulate resetting cached scanner positionsmm/ | +10 | 0 replies | |
| 4/5 | mm, compaction: always skip compound pages by order in migrate scannermm/ | +17 | 1 reply | |
| 5/5 | mm, compaction: skip compound pages by order in free scannermm/ | +25 | 0 replies |
Reviews trailers per patch
All 5 patches have a Reviewed-by or Acked-by.
| Patch | Mel Gorman | Joonsoo Kim | Michal Nazarewicz | Rik van Riel |
|---|---|---|---|---|
| 1/5 | A-b | A-b | A-b | A-b |
| 2/5 | A-b | A-b | A-b | |
| 3/5 | A-b | |||
| 4/5 | A-b A-b | A-b A-b | A-b A-b | |
| 5/5 | A-b | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.
Cover letter [PATCH v2 0/5] Assorted compaction cleanups and optimizations
v2 changes:
- dropped Patch 6 as adjusting to Joonsoo's objection would be too complicated and the results didn't justify it
- don't check for compound order > 0 in patches 4 and 5 as suggested by Michal Nazarewicz. Negative values are handled by converting to unsinged int, the pfn calculations work fine with 0 and it's unlikely to see 0 due to a race when we just checked PageCompound().
This series is partly the cleanups that were posted as part of the RFC for changing initial scanning positions [1] and partly new relatively simple scanner optimizations (yes, they are still possible). I've resumed working on the bigger scanner changes, but that will take a while, so no point in delaying these smaller patches.
The interesting patches are 4 and 5. In 4, skipping of compound pages in single iteration is improved for migration scanner, so it works also for !PageLRU compound pages such as hugetlbfs, slab etc. Patch 5 introduces this kind of skipping in the free scanner. The trick is that we can read compound_order() without any protection, if we are careful to filter out values larger than MAX_ORDER. The only danger is that we skip too much. The same trick was already used for reading the freepage order in the migrate scanner.
To demonstrate improvements of Patches 4 and 5 I've run stress-highalloc from mmtests, set to simulate THP allocations (including __GFP_COMP) on a 4GB system where 1GB was occupied by hugetlbfs pages. I'll include just the relevant stats:
Patch 3 Patch 4 Patch 5
Compaction stalls 7523 7529 7515
Compaction success 323 304 322
Compaction failures 7200 7224 7192
Page migrate success 247778 264395 240737
Page migrate failure 15358 33184 21621
Compaction pages isolated 906928 980192 909983
Compaction migrate scanned 2005277 1692805 1498800
Compaction free scanned 13255284 11539986 9011276
Compaction cost 288 305 277
With 5 iterations per patch, the results are still noisy, but we can see that Patch 4 does reduce migrate_scanned by 15% thanks to skipping the hugetlbfs pages at once. Interestingly, free_scanned is also reduced and I have no idea why. Patch 5 further reduces free_scanned as expected, by 15%. Other stats are unaffected modulo noise.
[1] https://lkml.org/lkml/2015/1/19/158
Vlastimil Babka (5):
mm, compaction: more robust check for scanners meeting
mm, compaction: simplify handling restart position in free pages
scanner
mm, compaction: encapsulate resetting cached scanner positions mm, compaction: always skip compound pages by order in migrate scanner mm, compaction: skip compound pages by order in free scanner
mm/compaction.c | 134 ++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 86 insertions(+), 48 deletions(-)
Signature · 7 lines
2.4.6 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>