diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 5702bf54e0e6..2ce349294f3d 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -275,6 +275,8 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_commit_creds); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_exit_creds); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_override_creds); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_revert_creds); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_dm_bufio_shrink_scan_bypass); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cleanup_old_buffers_bypass); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_record_mutex_lock_starttime); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_record_rtmutex_lock_starttime); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_record_rwsem_lock_starttime); diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c index 50f3e673729c..bb0e3ddde093 100644 --- a/drivers/md/dm-bufio.c +++ b/drivers/md/dm-bufio.c @@ -19,6 +19,8 @@ #include #include +#include + #define DM_MSG_PREFIX "bufio" /* @@ -1683,6 +1685,13 @@ static void shrink_work(struct work_struct *w) static unsigned long dm_bufio_shrink_scan(struct shrinker *shrink, struct shrink_control *sc) { struct dm_bufio_client *c; + bool bypass = false; + + trace_android_vh_dm_bufio_shrink_scan_bypass( + dm_bufio_current_allocated, + &bypass); + if (bypass) + return 0; c = container_of(shrink, struct dm_bufio_client, shrinker); atomic_long_add(sc->nr_to_scan, &c->need_shrink); @@ -2009,6 +2018,14 @@ static void cleanup_old_buffers(void) { unsigned long max_age_hz = get_max_age_hz(); struct dm_bufio_client *c; + bool bypass = false; + + trace_android_vh_cleanup_old_buffers_bypass( + dm_bufio_current_allocated, + &max_age_hz, + &bypass); + if (bypass) + return; mutex_lock(&dm_bufio_clients_lock); diff --git a/include/trace/hooks/mm.h b/include/trace/hooks/mm.h index a4b855e0a81a..8fecbc8b3d5b 100644 --- a/include/trace/hooks/mm.h +++ b/include/trace/hooks/mm.h @@ -126,6 +126,14 @@ DECLARE_HOOK(android_vh_save_track_hash, DECLARE_HOOK(android_vh_vmpressure, TP_PROTO(struct mem_cgroup *memcg, bool *bypass), TP_ARGS(memcg, bypass)); +DECLARE_HOOK(android_vh_dm_bufio_shrink_scan_bypass, + TP_PROTO(unsigned long dm_bufio_current_allocated, bool *bypass), + TP_ARGS(dm_bufio_current_allocated, bypass)); +DECLARE_HOOK(android_vh_cleanup_old_buffers_bypass, + TP_PROTO(unsigned long dm_bufio_current_allocated, + unsigned long *max_age_hz, + bool *bypass), + TP_ARGS(dm_bufio_current_allocated, max_age_hz, bypass)); DECLARE_HOOK(android_vh_mem_cgroup_alloc, TP_PROTO(struct mem_cgroup *memcg), TP_ARGS(memcg));