Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 8122f8f

Browse files
Qinglin Liandroid-build-merge-worker-robot
authored andcommitted
ANDROID: vendor_hooks: Add hooks for isolate lru folio am: f5df5e6
Original change: https://android-review.googlesource.com/c/kernel/common/+/3834194 Change-Id: I47a330cf9099889a2c18fa381c9ba960420ec500 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2 parents b662278 + f5df5e6 commit 8122f8f

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

drivers/android/vendor_hooks.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,3 +660,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_kswapd_shrink_node);
660660
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_keep_reclaimed_folio);
661661
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_clear_reclaimed_folio);
662662
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_evict_folios_bypass);
663+
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_may_unmap_folio);

include/trace/hooks/vmscan.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
struct mem_cgroup_reclaim_cookie;
1313
struct lruvec;
14+
struct scan_control;
1415

1516
DECLARE_RESTRICTED_HOOK(android_rvh_set_balance_anon_file_reclaim,
1617
TP_PROTO(bool *balance_anon_file_reclaim),
@@ -141,6 +142,10 @@ DECLARE_HOOK(android_vh_mm_customize_pgdat_balanced,
141142
DECLARE_HOOK(android_vh_mm_customize_reclaim_idx,
142143
TP_PROTO(int order, gfp_t gfp, s8 *reclaim_idx, enum zone_type *highest_zoneidx),
143144
TP_ARGS(order, gfp, reclaim_idx, highest_zoneidx));
145+
DECLARE_HOOK(android_vh_may_unmap_folio,
146+
TP_PROTO(enum lru_list lru, struct scan_control *sc, struct folio *folio, bool *bypass),
147+
TP_ARGS(lru, sc, folio, bypass));
148+
144149
#endif /* _TRACE_HOOK_VMSCAN_H */
145150
/* This part must be outside protection */
146151
#include <trace/define_trace.h>

mm/vmscan.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,6 +1774,7 @@ static unsigned long isolate_lru_folios(unsigned long nr_to_scan,
17741774
unsigned long scan, total_scan, nr_pages;
17751775
LIST_HEAD(folios_skipped);
17761776
unsigned long nr_scanned_before = *nr_scanned;
1777+
bool bypass = false;
17771778

17781779
trace_android_vh_mm_isolate_priv_lru(nr_to_scan, lruvec, lru, dst, sc->reclaim_idx,
17791780
sc->may_unmap, nr_scanned, &nr_taken);
@@ -1810,6 +1811,11 @@ static unsigned long isolate_lru_folios(unsigned long nr_to_scan,
18101811

18111812
if (!folio_test_lru(folio))
18121813
goto move;
1814+
1815+
trace_android_vh_may_unmap_folio(lru, sc, folio, &bypass);
1816+
if (bypass)
1817+
goto move;
1818+
18131819
if (!sc->may_unmap && folio_mapped(folio))
18141820
goto move;
18151821

0 commit comments

Comments
 (0)