1 #ifndef __CPU_COMMON_H__
2 #define __CPU_COMMON_H__
6 #include <cpu-boosting-type.h>
7 #include <cpu-boosting-private.h>
13 #endif /* __cplusplus */
15 #define CPU_INIT_NICE 100
16 #define CPU_MAX_NICE 19
17 #define CPU_MIN_NICE -20
18 #define CPU_DEFAULT_NICE 0
20 #define CPU_INIT_PRIO 0
21 #define CPU_MAX_PRIO 99
22 #define CPU_MIN_PRIO 1
24 #define CPU_DEFAULT_SHARE 1024
25 #define CPU_THROTTLING_SHARE 64
28 CPU_SCHED_UNINITIALIZED = 0,
29 CPU_SCHED_RUNTIME_SHARE = 1,
30 CPU_SCHED_NO_RUNTIME_SHARE = 2,
31 CPU_SCHED_RUNTIME_GREED = 4,
44 struct cpu_sched_info {
45 enum cpu_sched_type cpu_sched_type;
46 int cpu_nice; /* fixed cpu nice */
47 int cpu_rt_priority; /* fixed cpu priority for rt schedulers */
50 struct cpuset_cgroup_info {
63 bool disclaimer_shown;
66 struct cpu_cgroup_info {
67 long long cfs_runtime_us;
68 long long rt_runtime_us;
69 unsigned long long cfs_period_us;
70 unsigned long long rt_period_us;
71 unsigned long long cpu_share;
74 struct cpu_sched_conf {
75 enum cpu_sched_flag cpu_sched_flag;
76 struct cpu_cgroup_info cpu_cgroup_info;
79 struct cpu_affinity_conf {
80 struct cpuset_cgroup_info cpuset_cgroup_info;
83 struct cpu_throttling_conf {
85 struct cpu_sched_info cpu_sched_info;
86 struct cpu_cgroup_info cpu_cgroup_info;
89 struct cpu_boosting_conf {
91 struct cpu_sched_info cpu_sched_info;
94 void cpu_boosting_enable_cpu_stall_handler(void);
95 bool cpu_boosting_is_enabled_of_cpu_stall_handler(void);
98 struct cpu_sched_conf *get_cpu_sched_conf(void);
99 void free_cpu_sched_conf(void);
101 char *get_cpu_affinity_conf_name(void);
102 char *get_cpu_affinity_conf_value(void);
103 int set_cpu_affinity_conf(const char *name, const char *value);
104 void free_cpu_affinity_conf(void);
106 struct cpu_throttling_conf *get_cpu_throttling_conf(void);
107 void free_cpu_throttling_conf(void);
109 struct cpu_boosting_conf *get_cpu_boosting_conf(cpu_boosting_level_e level);
110 void free_cpu_boosting_conf(cpu_boosting_level_e level);
114 #endif /* __cplusplus */
116 #endif /* __CPU_COMMON_H__ */