Skip to content

mm/page_alloc: rework conditional splitting >= pageblock_order pages when freeing

David Hildenbrand linux-mm lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 3 repliesIn review
  2. v12 patches 11 repliesSuperseded

Changes in v2 from the cover letter

* "mm/page_alloc: conditionally split > pageblock_order pages in free_one_page() and move_freepages_block_isolate()"
-> Similarly avoid pfn_to_page() on something that might not be a valid pfn -> Add a comment regarding using "zone->nr_isolate_pageblock" in the
future to the patch description

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2mm/page_alloc: conditionally split > pageblock_order pages in free_one_page() and move_freepages_block_isolate()mm/page_alloc.c+59 -143 replies
2/2mm/page_isolation: fixup isolate_single_pageblock() comment regarding splitting free pagesmm/page_isolation.c+4 -50 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchZi YanYu ZhaoVlastimil Babka
1/2R-b A-b A-b
2/2R-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 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 0/2] mm/page_alloc: rework conditional splitting >= pageblock_order pages when freeing

Now based on [1].

Looking into recent alloc_contig_range(__GFP_COMP) support, I realized that we now unconditionally split up high-order pages on the page freeing path to free in pageblock granularity, just to immediately let the buddy merge them again in the common case.

Let's optimize for the common case (all pageblock migratetypes match), and enable it only in configs where this is strictly required. Further, add some comments that explain why this special casing is required at all.

Alongside, a fix for a stale comment in page isolation code.

Tested with runtime allocation of gigantic pages and virtio-mem.

v1 -> v2:
* "mm/page_alloc: conditionally split > pageblock_order pages in free_one_page() and move_freepages_block_isolate()"
-> Similarly avoid pfn_to_page() on something that might not be a valid pfn -> Add a comment regarding using "zone->nr_isolate_pageblock" in the
future to the patch description

Cc Andrew Morton <[email protected]>
Cc Zi Yan <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Yu Zhao <[email protected]>

[1] https://lkml.kernel.org/r/[email protected]

David Hildenbrand (2):
mm/page_alloc: conditionally split > pageblock_order pages in
free_one_page() and move_freepages_block_isolate()
mm/page_isolation: fixup isolate_single_pageblock() comment regarding
splitting free pages

 mm/page_alloc.c     | 73 ++++++++++++++++++++++++++++++++++++---------
 mm/page_isolation.c |  9 +++---
 2 files changed, 63 insertions(+), 19 deletions(-)
Signature · 1 line
2.47.1