From b3a2458fc6e6bf265ee52297f6478e4b43725fb2 Mon Sep 17 00:00:00 2001 From: Dmitry Skiba Date: Wed, 18 Sep 2024 22:16:12 +0000 Subject: [PATCH] ANDROID: mm: add vh for kcompactd_cpu_online() kcompactd_cpu_online() changes kcompactd cpumask, potentially overwriting any vendor-specific cpumask that was there. This hook allows vendors to re-set the cpumask. Bug: 367400751 Change-Id: I45b92bcd16fbf2d5d76474287db659e32af64201 Signed-off-by: Dmitry Skiba --- drivers/android/vendor_hooks.c | 1 + include/trace/hooks/mm.h | 3 +++ mm/compaction.c | 1 + 3 files changed, 5 insertions(+) diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index a177b4fee436..ebf5c1c0e7a1 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -378,6 +378,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_alloc_pages_may_oom_exit); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_vmscan_kswapd_done); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_compaction_begin); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_compaction_end); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_kcompactd_cpu_online); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_bus_iommu_probe); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rmqueue); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_resume_begin); diff --git a/include/trace/hooks/mm.h b/include/trace/hooks/mm.h index 90237954c83d..930fb08e91d5 100644 --- a/include/trace/hooks/mm.h +++ b/include/trace/hooks/mm.h @@ -145,6 +145,9 @@ DECLARE_HOOK(android_vh_mm_compaction_begin, DECLARE_HOOK(android_vh_mm_compaction_end, TP_PROTO(struct compact_control *cc, long vendor_ret), TP_ARGS(cc, vendor_ret)); +DECLARE_HOOK(android_vh_mm_kcompactd_cpu_online, + TP_PROTO(int cpu), + TP_ARGS(cpu)); DECLARE_HOOK(android_vh_free_unref_page_bypass, TP_PROTO(struct page *page, int order, int migratetype, bool *bypass), TP_ARGS(page, order, migratetype, bypass)); diff --git a/mm/compaction.c b/mm/compaction.c index 6dbb02de8b9d..1ff0bafa46d6 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -3070,6 +3070,7 @@ static int kcompactd_cpu_online(unsigned int cpu) if (pgdat->kcompactd) set_cpus_allowed_ptr(pgdat->kcompactd, mask); } + trace_android_vh_mm_kcompactd_cpu_online(cpu); return 0; }