diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index ab32e0c9b662..f167a0177a12 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -449,6 +449,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_vmscan_kswapd_wake); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_vmscan_kswapd_done); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_customize_alloc_gfp); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_kcompactd_cpu_online); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_adjust_swap_info_flags); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_direct_reclaim_begin); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_direct_reclaim_end); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_do_read_fault); diff --git a/include/trace/hooks/mm.h b/include/trace/hooks/mm.h index 25446c7ff5fa..c1f63bf13f39 100644 --- a/include/trace/hooks/mm.h +++ b/include/trace/hooks/mm.h @@ -399,6 +399,9 @@ DECLARE_HOOK(android_vh_customize_alloc_gfp, DECLARE_HOOK(android_vh_mm_kcompactd_cpu_online, TP_PROTO(int cpu), TP_ARGS(cpu)); +DECLARE_HOOK(android_vh_adjust_swap_info_flags, + TP_PROTO(unsigned long *flags), + TP_ARGS(flags)); DECLARE_HOOK(android_rvh_alloc_pages_reclaim_start, TP_PROTO(gfp_t gfp_mask, int order, int *alloc_flags), TP_ARGS(gfp_mask, order, alloc_flags)); diff --git a/mm/swapfile.c b/mm/swapfile.c index 64c93f1869f2..ce84a3361046 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -50,6 +50,7 @@ #include "internal.h" #include "swap.h" #include +#include static bool swap_count_continued(struct swap_info_struct *, pgoff_t, unsigned char); @@ -3500,6 +3501,8 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags) if (si->bdev && bdev_synchronous(si->bdev)) si->flags |= SWP_SYNCHRONOUS_IO; + trace_android_vh_adjust_swap_info_flags(&si->flags); + if (si->bdev && !hibernation_swap && bdev_nonrot(si->bdev)) { si->flags |= SWP_SOLIDSTATE;