History

mm: page_alloc: move capture_control to the page allocator

The compaction capturing code assumes the allocation request order and compaction target order are the same. That won't be true once defrag_mode promotes sub-block allocations to pageblock-order compaction: compaction targets the larger order, while capture should remain at the original allocation order. Move the capture_control to the page allocator and give it its own copies of what the page freeing path matches against - zone, migratetype and the allocation order - rather than reaching into compaction's live compact_control. __alloc_pages_direct_compact() fills in migratetype and order, and installs and hides current->capture_control around the whole compaction call; try_to_compact_pages() aims capc->zone at each zone while it is being compacted. compact_zone_order() no longer deals with capture at all. Pass the capture_control through try_to_compact_pages() / compact_zone_order() in place of the bare struct page **. No functional change.

Vlastimil Babka (SUSE) committed 3 months ago

Commit aee220f1 parent 1b4b6974 files · +57 −45Browse files

Showing the changes to include (1 of 4 files). Show all

Unified · Split

include/linux/compaction.h+2−1
@@ -58,6 +58,7 @@ enum compact_result { · 57 unmodified lines
5858 };
5959
6060 struct alloc_context; /* in mm/internal.h */
61+struct capture_control; /* in mm/internal.h */
6162
6263 /*
6364 * Number of free order-0 pages that should be available above given watermark
@@ -92,7 +93,7 @@ extern int fragmentation_index(struct zone *zone, unsigned int order); · 28 unmodified lines
9293 extern enum compact_result try_to_compact_pages(gfp_t gfp_mask,
9394 unsigned int order, unsigned int alloc_flags,
9495 const struct alloc_context *ac, enum compact_priority prio,
95− struct page **page);
96+ struct capture_control *capc);
9697 extern void reset_isolation_suitable(pg_data_t *pgdat);
9798 extern bool compaction_suitable(struct zone *zone, int order,
9899 unsigned long watermark, int highest_zoneidx);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t