aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPark Bumgyu2020-12-22 18:44:37 -0600
committerTodd Kjos2021-01-04 12:51:30 -0600
commit4eae6d1947bf494dbb97e2b45c76d40c5eb3ec6d (patch)
tree28dd56b4848eac9ff90d79f7b3581bce9ac06855
parentcfe05bdbf970bb9bdcdccb62ebb485f9e3a3148f (diff)
downloadkernel-4eae6d1947bf494dbb97e2b45c76d40c5eb3ec6d.tar.gz
kernel-4eae6d1947bf494dbb97e2b45c76d40c5eb3ec6d.tar.xz
kernel-4eae6d1947bf494dbb97e2b45c76d40c5eb3ec6d.zip
ANDROID: vendor_hook: modify cpuidle vendor hook
When entering cluster-wide or system-wide power mode, Exynos cpu power management driver checks the next hrtimer events of cpu composing the power domain to prevent unnecessary attempts to enter the power mode. Since struct cpuidle_device has next_hrtimer, it can be solved by passing cpuidle device as a parameter of vh. In order to improve responsiveness, it is necessary to prevent entering the deep idle state in boosting scenario. So, vendor driver should be able to control the idle state. Due to above requirements, the parameters required for idle enter and exit different, so the vendor hook is separated into cpu_idle_enter and cpu_idle_exit. Bug: 176198732 Change-Id: I2262ba1bae5e6622a8e76bc1d5d16fb27af0bb8a Signed-off-by: Park Bumgyu <bumgyu.park@samsung.com>
-rw-r--r--drivers/android/vendor_hooks.c3
-rw-r--r--drivers/cpuidle/cpuidle.c4
-rw-r--r--include/trace/hooks/cpuidle.h14
3 files changed, 14 insertions, 7 deletions
diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c
index b4cacb2071f8..7d0ed9fedc32 100644
--- a/drivers/android/vendor_hooks.c
+++ b/drivers/android/vendor_hooks.c
@@ -63,7 +63,8 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_read_wait_finish);
63EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_write_wait_start); 63EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_write_wait_start);
64EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_write_wait_finish); 64EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_write_wait_finish);
65EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sched_show_task); 65EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sched_show_task);
66EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpu_idle); 66EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpu_idle_enter);
67EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpu_idle_exit);
67EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mpam_set); 68EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mpam_set);
68EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_find_busiest_group); 69EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_find_busiest_group);
69EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_gic_resume); 70EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_gic_resume);
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index fa0024b4549b..84fdc7cc89cd 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -229,7 +229,7 @@ int cpuidle_enter_state(struct cpuidle_device *dev, struct cpuidle_driver *drv,
229 /* Take note of the planned idle state. */ 229 /* Take note of the planned idle state. */
230 sched_idle_set_state(target_state); 230 sched_idle_set_state(target_state);
231 231
232 trace_android_vh_cpu_idle(0, index, dev->cpu); 232 trace_android_vh_cpu_idle_enter(&index, dev);
233 trace_cpu_idle(index, dev->cpu); 233 trace_cpu_idle(index, dev->cpu);
234 time_start = ns_to_ktime(local_clock()); 234 time_start = ns_to_ktime(local_clock());
235 235
@@ -244,7 +244,7 @@ int cpuidle_enter_state(struct cpuidle_device *dev, struct cpuidle_driver *drv,
244 sched_clock_idle_wakeup_event(); 244 sched_clock_idle_wakeup_event();
245 time_end = ns_to_ktime(local_clock()); 245 time_end = ns_to_ktime(local_clock());
246 trace_cpu_idle(PWR_EVENT_EXIT, dev->cpu); 246 trace_cpu_idle(PWR_EVENT_EXIT, dev->cpu);
247 trace_android_vh_cpu_idle(PWR_EVENT_EXIT, entered_state, dev->cpu); 247 trace_android_vh_cpu_idle_exit(entered_state, dev);
248 248
249 /* The cpu is no longer idle or about to enter idle. */ 249 /* The cpu is no longer idle or about to enter idle. */
250 sched_idle_set_state(NULL); 250 sched_idle_set_state(NULL);
diff --git a/include/trace/hooks/cpuidle.h b/include/trace/hooks/cpuidle.h
index 826e98e37690..28b39f490ef8 100644
--- a/include/trace/hooks/cpuidle.h
+++ b/include/trace/hooks/cpuidle.h
@@ -11,11 +11,17 @@
11#include <trace/hooks/vendor_hooks.h> 11#include <trace/hooks/vendor_hooks.h>
12 12
13#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS) 13#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS)
14DECLARE_HOOK(android_vh_cpu_idle, 14struct cpuidle_device;
15 TP_PROTO(int event, int state, int cpu), 15
16 TP_ARGS(event, state, cpu)) 16DECLARE_HOOK(android_vh_cpu_idle_enter,
17 TP_PROTO(int *state, struct cpuidle_device *dev),
18 TP_ARGS(state, dev))
19DECLARE_HOOK(android_vh_cpu_idle_exit,
20 TP_PROTO(int state, struct cpuidle_device *dev),
21 TP_ARGS(state, dev))
17#else 22#else
18#define trace_android_vh_cpu_idle(event, state, cpu) 23#define trace_android_vh_cpu_idle_enter(state, dev)
24#define trace_android_vh_cpu_idle_exit(state, dev)
19#endif 25#endif
20 26
21#endif /* _TRACE_HOOK_CPUIDLE_H */ 27#endif /* _TRACE_HOOK_CPUIDLE_H */