mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
cpufreq: interactive: New 'interactive' governor
Change-Id: I23b6b07b5dc44f51e18bd6430d4908b49c1c1813 Signed-off-by: Liang Chen <cl@rock-chips.com>
This commit is contained in:
@@ -101,6 +101,15 @@ config CPU_FREQ_DEFAULT_GOV_CONSERVATIVE
|
||||
governor. If unsure have a look at the help section of the
|
||||
driver. Fallback governor will be the performance governor.
|
||||
|
||||
config CPU_FREQ_DEFAULT_GOV_INTERACTIVE
|
||||
bool "interactive"
|
||||
select CPU_FREQ_GOV_INTERACTIVE
|
||||
help
|
||||
Use the CPUFreq governor 'interactive' as default. This allows
|
||||
you to get a full dynamic cpu frequency capable system by simply
|
||||
loading your cpufreq low-level hardware driver, using the
|
||||
'interactive' governor for latency-sensitive workloads.
|
||||
|
||||
config CPU_FREQ_DEFAULT_GOV_SCHEDUTIL
|
||||
bool "schedutil"
|
||||
depends on SMP
|
||||
@@ -192,6 +201,20 @@ config CPU_FREQ_GOV_CONSERVATIVE
|
||||
|
||||
If in doubt, say N.
|
||||
|
||||
config CPU_FREQ_GOV_INTERACTIVE
|
||||
bool "'interactive' cpufreq policy governor"
|
||||
help
|
||||
'interactive' - This driver adds a dynamic cpufreq policy governor
|
||||
designed for latency-sensitive workloads.
|
||||
|
||||
This governor attempts to reduce the latency of clock
|
||||
increases so that the system is more responsive to
|
||||
interactive workloads.
|
||||
|
||||
For details, take a look at linux/Documentation/cpu-freq.
|
||||
|
||||
If in doubt, say N.
|
||||
|
||||
config CPU_FREQ_GOV_SCHEDUTIL
|
||||
bool "'schedutil' cpufreq policy governor"
|
||||
depends on CPU_FREQ && SMP
|
||||
|
||||
@@ -14,6 +14,7 @@ obj-$(CONFIG_CPU_FREQ_GOV_POWERSAVE) += cpufreq_powersave.o
|
||||
obj-$(CONFIG_CPU_FREQ_GOV_USERSPACE) += cpufreq_userspace.o
|
||||
obj-$(CONFIG_CPU_FREQ_GOV_ONDEMAND) += cpufreq_ondemand.o
|
||||
obj-$(CONFIG_CPU_FREQ_GOV_CONSERVATIVE) += cpufreq_conservative.o
|
||||
obj-$(CONFIG_CPU_FREQ_GOV_INTERACTIVE) += cpufreq_interactive.o
|
||||
obj-$(CONFIG_CPU_FREQ_GOV_COMMON) += cpufreq_governor.o
|
||||
obj-$(CONFIG_CPU_FREQ_GOV_ATTR_SET) += cpufreq_governor_attr_set.o
|
||||
|
||||
|
||||
1571
drivers/cpufreq/cpufreq_interactive.c
Normal file
1571
drivers/cpufreq/cpufreq_interactive.c
Normal file
File diff suppressed because it is too large
Load Diff
113
include/trace/events/cpufreq_interactive.h
Normal file
113
include/trace/events/cpufreq_interactive.h
Normal file
@@ -0,0 +1,113 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#undef TRACE_SYSTEM
|
||||
#define TRACE_SYSTEM cpufreq_interactive
|
||||
|
||||
#if !defined(_TRACE_CPUFREQ_INTERACTIVE_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||
#define _TRACE_CPUFREQ_INTERACTIVE_H
|
||||
|
||||
#include <linux/tracepoint.h>
|
||||
|
||||
DECLARE_EVENT_CLASS(set,
|
||||
TP_PROTO(u32 cpu_id, unsigned long targfreq,
|
||||
unsigned long actualfreq),
|
||||
TP_ARGS(cpu_id, targfreq, actualfreq),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field( u32, cpu_id )
|
||||
__field(unsigned long, targfreq )
|
||||
__field(unsigned long, actualfreq )
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->cpu_id = (u32) cpu_id;
|
||||
__entry->targfreq = targfreq;
|
||||
__entry->actualfreq = actualfreq;
|
||||
),
|
||||
|
||||
TP_printk("cpu=%u targ=%lu actual=%lu",
|
||||
__entry->cpu_id, __entry->targfreq,
|
||||
__entry->actualfreq)
|
||||
);
|
||||
|
||||
DEFINE_EVENT(set, cpufreq_interactive_setspeed,
|
||||
TP_PROTO(u32 cpu_id, unsigned long targfreq,
|
||||
unsigned long actualfreq),
|
||||
TP_ARGS(cpu_id, targfreq, actualfreq)
|
||||
);
|
||||
|
||||
DECLARE_EVENT_CLASS(loadeval,
|
||||
TP_PROTO(unsigned long cpu_id, unsigned long load,
|
||||
unsigned long curtarg, unsigned long curactual,
|
||||
unsigned long newtarg),
|
||||
TP_ARGS(cpu_id, load, curtarg, curactual, newtarg),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(unsigned long, cpu_id )
|
||||
__field(unsigned long, load )
|
||||
__field(unsigned long, curtarg )
|
||||
__field(unsigned long, curactual )
|
||||
__field(unsigned long, newtarg )
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->cpu_id = cpu_id;
|
||||
__entry->load = load;
|
||||
__entry->curtarg = curtarg;
|
||||
__entry->curactual = curactual;
|
||||
__entry->newtarg = newtarg;
|
||||
),
|
||||
|
||||
TP_printk("cpu=%lu load=%lu cur=%lu actual=%lu targ=%lu",
|
||||
__entry->cpu_id, __entry->load, __entry->curtarg,
|
||||
__entry->curactual, __entry->newtarg)
|
||||
);
|
||||
|
||||
DEFINE_EVENT(loadeval, cpufreq_interactive_target,
|
||||
TP_PROTO(unsigned long cpu_id, unsigned long load,
|
||||
unsigned long curtarg, unsigned long curactual,
|
||||
unsigned long newtarg),
|
||||
TP_ARGS(cpu_id, load, curtarg, curactual, newtarg)
|
||||
);
|
||||
|
||||
DEFINE_EVENT(loadeval, cpufreq_interactive_already,
|
||||
TP_PROTO(unsigned long cpu_id, unsigned long load,
|
||||
unsigned long curtarg, unsigned long curactual,
|
||||
unsigned long newtarg),
|
||||
TP_ARGS(cpu_id, load, curtarg, curactual, newtarg)
|
||||
);
|
||||
|
||||
DEFINE_EVENT(loadeval, cpufreq_interactive_notyet,
|
||||
TP_PROTO(unsigned long cpu_id, unsigned long load,
|
||||
unsigned long curtarg, unsigned long curactual,
|
||||
unsigned long newtarg),
|
||||
TP_ARGS(cpu_id, load, curtarg, curactual, newtarg)
|
||||
);
|
||||
|
||||
TRACE_EVENT(cpufreq_interactive_boost,
|
||||
TP_PROTO(const char *s),
|
||||
TP_ARGS(s),
|
||||
TP_STRUCT__entry(
|
||||
__string(s, s)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__assign_str(s, s);
|
||||
),
|
||||
TP_printk("%s", __get_str(s))
|
||||
);
|
||||
|
||||
TRACE_EVENT(cpufreq_interactive_unboost,
|
||||
TP_PROTO(const char *s),
|
||||
TP_ARGS(s),
|
||||
TP_STRUCT__entry(
|
||||
__string(s, s)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__assign_str(s, s);
|
||||
),
|
||||
TP_printk("%s", __get_str(s))
|
||||
);
|
||||
|
||||
#endif /* _TRACE_CPUFREQ_INTERACTIVE_H */
|
||||
|
||||
/* This part must be outside protection */
|
||||
#include <trace/define_trace.h>
|
||||
Reference in New Issue
Block a user