ANDROID: mm: add vendor hook to bypass migration target

Add a vendor hook to skip certain page block for compaction target.

Bug: 378012042
Change-Id: Ibed26c4d8a7ea9eb4d1900a16f15498267867f6b
Signed-off-by: Sooyong Suk <s.suk@samsung.corp-partner.google.com>
This commit is contained in:
Sooyong Suk
2024-11-12 15:09:12 +09:00
committed by Todd Kjos
parent c16ea53e9a
commit 0457ed368f
3 changed files with 15 additions and 0 deletions
+1
View File
@@ -180,6 +180,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_isolate_freepages);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_oom_check_panic);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rmqueue_smallest_bypass);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_free_one_page_bypass);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_migration_target_bypass);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_adjust_alloc_flags);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_wait_for_work);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_oem_binder_struct);
+3
View File
@@ -64,6 +64,9 @@ DECLARE_HOOK(android_vh_free_one_page_bypass,
TP_PROTO(struct page *page, struct zone *zone, int order, int migratetype,
int fpi_flags, bool *bypass),
TP_ARGS(page, zone, order, migratetype, fpi_flags, bypass));
DECLARE_HOOK(android_vh_migration_target_bypass,
TP_PROTO(struct page *page, bool *bypass),
TP_ARGS(page, bypass));
struct page_vma_mapped_walk;
DECLARE_HOOK(android_vh_slab_alloc_node,
+11
View File
@@ -1417,6 +1417,8 @@ static bool suitable_migration_source(struct compact_control *cc,
static bool suitable_migration_target(struct compact_control *cc,
struct page *page)
{
bool bypass = false;
/* If the page is a large free page, then disallow migration */
if (PageBuddy(page)) {
int order = cc->order > 0 ? cc->order : pageblock_order;
@@ -1430,6 +1432,10 @@ static bool suitable_migration_target(struct compact_control *cc,
return false;
}
trace_android_vh_migration_target_bypass(page, &bypass);
if (bypass)
return false;
if (cc->ignore_block_suitable)
return true;
@@ -1497,6 +1503,7 @@ fast_isolate_around(struct compact_control *cc, unsigned long pfn)
{
unsigned long start_pfn, end_pfn;
struct page *page;
bool bypass = false;
/* Do not search around if there are enough pages already */
if (cc->nr_freepages >= cc->nr_migratepages)
@@ -1514,6 +1521,10 @@ fast_isolate_around(struct compact_control *cc, unsigned long pfn)
if (!page)
return;
trace_android_vh_migration_target_bypass(page, &bypass);
if (bypass)
return;
isolate_freepages_block(cc, &start_pfn, end_pfn, cc->freepages, 1, false);
/* Skip this pageblock in the future as it's full or nearly full */