ANDROID: vendor_hook: Added hook for memory reclaim tuning

The following hooks are added for memory reclaim tuning:

android_vh_mm_isolate_priv_lru - This hook is used to properly handle certain
folios when they are reclaimed.

android_vh_mm_customize_file_is_tiny - For a specific process, we want only
anonymous pages to be reclaimed. This hook allows vendors to modify the value
of file_is_tiny to affect the reclaim behavior.

android_vh_mm_customize_pgdat_balanced - When there are multiple zones, it is
not always reasonable to perform indirect reclaim only when all zones do not
meet the watermark. This hook allows vendors to customize pgdat_balanced to use
their own strategy to determine whether to perform and stop indirect collection.

android_vh_mm_customize_reclaim_idx - When there are multiple zones, vendors use
this hook to customize which zones can be reclaimed.

android_vh_mm_customize_zone_can_compact - When there are multiple zones, vendors
use this hook to customize which zones can be compacted.

Bug: 431672372
Change-Id: I860c2665088753a5c3b6d6dfeeb25a82aeefc8af
Signed-off-by: Pengfei Li <pengfei.kernel@vivo.corp-partner.google.com>
This commit is contained in:
Pengfei Li
2025-07-14 16:05:00 +08:00
committed by T.J. Mercier
parent 73c426b11f
commit 6c25b93a26
5 changed files with 81 additions and 2 deletions
+5
View File
@@ -599,3 +599,8 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_customize_suitable_zone);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_customize_wmark_ok);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_customize_zone_max_order);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_customize_zone_pageset);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_isolate_priv_lru);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_customize_file_is_tiny);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_customize_pgdat_balanced);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_customize_reclaim_idx);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_customize_zone_can_compact);