ANDROID: mm: add vendor hook for compaction

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

Bug: 351175506
Change-Id: I81de4e5cd2c6d042ccb17f79264fa08b13af3915
Signed-off-by: Sooyong Suk <s.suk@samsung.corp-partner.google.com>
This commit is contained in:
Sooyong Suk 2024-09-04 10:15:40 +09:00 committed by Treehugger Robot
parent a7d1ee788f
commit 8936b3531c
3 changed files with 10 additions and 0 deletions

View File

@ -544,3 +544,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_init_adjust_zone_wmark);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cma_alloc_retry);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_ksys_umount);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_do_group_exit);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_suitable_migration_target_bypass);

View File

@ -396,6 +396,9 @@ DECLARE_HOOK(android_vh_cma_alloc_retry,
DECLARE_HOOK(android_vh_do_group_exit,
TP_PROTO(struct task_struct *tsk),
TP_ARGS(tsk));
DECLARE_HOOK(android_vh_suitable_migration_target_bypass,
TP_PROTO(struct page *page, bool *bypass),
TP_ARGS(page, bypass));
#endif /* _TRACE_HOOK_MM_H */
/* This part must be outside protection */

View File

@ -1377,6 +1377,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)) {
/*
@ -1388,6 +1390,10 @@ static bool suitable_migration_target(struct compact_control *cc,
return false;
}
trace_android_vh_suitable_migration_target_bypass(page, &bypass);
if (bypass)
return false;
if (cc->ignore_block_suitable)
return true;