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
58};58};
59 59
60struct alloc_context; /* in mm/internal.h */60struct alloc_context; /* in mm/internal.h */
61struct capture_control; /* in mm/internal.h */
61 62
62/*63/*
63 * Number of free order-0 pages that should be available above given watermark64 * 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
92extern enum compact_result try_to_compact_pages(gfp_t gfp_mask,93extern enum compact_result try_to_compact_pages(gfp_t gfp_mask,
93 unsigned int order, unsigned int alloc_flags,94 unsigned int order, unsigned int alloc_flags,
94 const struct alloc_context *ac, enum compact_priority prio,95 const struct alloc_context *ac, enum compact_priority prio,
95 struct page **page);96 struct capture_control *capc);
96extern void reset_isolation_suitable(pg_data_t *pgdat);97extern void reset_isolation_suitable(pg_data_t *pgdat);
97extern bool compaction_suitable(struct zone *zone, int order,98extern bool compaction_suitable(struct zone *zone, int order,
98 unsigned long watermark, int highest_zoneidx);99 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