Loading Documentation/scheduler/sched-hmp.txt +2 −1 Original line number Diff line number Diff line Loading @@ -1321,7 +1321,7 @@ Logged when selecting the best CPU to run a task (select_best_cpu() for fair class tasks, find_lowest_rq_hmp() for RT tasks) and load balancing (update_sg_lb_stats()). <idle>-0 [004] d.h3 12700.711541: sched_cpu_load: cpu 0 idle 1 mostly_idle 1 nr_run 0 nr_big 0 nr_small 0 lsf 1945 capacity 1045 cr_avg 0 irqload 4456 fcur 199200 fmax 940800 power_cost 1045 cstate 1 <idle>-0 [004] d.h3 12700.711541: sched_cpu_load: cpu 0 idle 1 mostly_idle 1 nr_run 0 nr_big 0 nr_small 0 lsf 1945 capacity 1045 cr_avg 0 irqload 4456 fcur 199200 fmax 940800 power_cost 1045 cstate 1 temp 73 - cpu: the CPU being described - idle: boolean indicating whether the CPU is idle Loading @@ -1339,6 +1339,7 @@ class tasks, find_lowest_rq_hmp() for RT tasks) and load balancing - fmax: max CPU frequency (but not maximum _possible_ frequency) (KHz) - power_cost: cost of running this CPU at the current frequency - cstate: current cstate of CPU - temp: current temperature of the CPU The power_cost value above differs in how it is calculated depending on the callsite of this tracepoint. The select_best_cpu() call to this tracepoint Loading include/trace/events/sched.h +6 −4 Original line number Diff line number Diff line Loading @@ -159,9 +159,9 @@ TRACE_EVENT(sched_task_load, TRACE_EVENT(sched_cpu_load, TP_PROTO(struct rq *rq, int idle, int mostly_idle, u64 irqload, unsigned int power_cost), unsigned int power_cost, int temp), TP_ARGS(rq, idle, mostly_idle, irqload, power_cost), TP_ARGS(rq, idle, mostly_idle, irqload, power_cost, temp), TP_STRUCT__entry( __field(unsigned int, cpu ) Loading @@ -178,6 +178,7 @@ TRACE_EVENT(sched_cpu_load, __field(unsigned int, max_freq ) __field(unsigned int, power_cost ) __field( int, cstate ) __field( int, temp ) ), TP_fast_assign( Loading @@ -195,15 +196,16 @@ TRACE_EVENT(sched_cpu_load, __entry->max_freq = rq->max_freq; __entry->power_cost = power_cost; __entry->cstate = rq->cstate; __entry->temp = temp; ), TP_printk("cpu %u idle %d mostly_idle %d nr_run %u nr_big %u nr_small %u lsf %u capacity %u cr_avg %llu irqload %llu fcur %u fmax %u power_cost %u cstate %d", TP_printk("cpu %u idle %d mostly_idle %d nr_run %u nr_big %u nr_small %u lsf %u capacity %u cr_avg %llu irqload %llu fcur %u fmax %u power_cost %u cstate %d temp %d", __entry->cpu, __entry->idle, __entry->mostly_idle, __entry->nr_running, __entry->nr_big_tasks, __entry->nr_small_tasks, __entry->load_scale_factor, __entry->capacity, __entry->cumulative_runnable_avg, __entry->irqload, __entry->cur_freq, __entry->max_freq, __entry->power_cost, __entry->cstate) __entry->power_cost, __entry->cstate, __entry->temp) ); TRACE_EVENT(sched_set_boost, Loading kernel/sched/fair.c +22 −3 Original line number Diff line number Diff line Loading @@ -1775,7 +1775,8 @@ static int best_small_task_cpu(struct task_struct *p, int sync) trace_sched_cpu_load(cpu_rq(i), idle_cpu(i), mostly_idle_cpu_sync(i, sync), sched_irqload(i), power_cost(p, i)); sched_irqload(i), power_cost(p, i), cpu_temp(i)); cpu_cost = power_cost(p, i); if (cpu_cost < min_cost) { Loading Loading @@ -1930,7 +1931,8 @@ static int select_best_cpu(struct task_struct *p, int target, int reason, trace_sched_cpu_load(cpu_rq(i), idle_cpu(i), mostly_idle_cpu_sync(i, sync), sched_irqload(i), power_cost(p, i)); sched_irqload(i), power_cost(p, i), cpu_temp(i)); if (skip_cpu(p, i, reason)) continue; Loading Loading @@ -2416,6 +2418,16 @@ static inline int is_cpu_throttling_imminent(int cpu) return throttling; } unsigned int cpu_temp(int cpu) { struct cpu_pwr_stats *per_cpu_info = get_cpu_pwr_stats(); if (per_cpu_info) return per_cpu_info[cpu].temp; else return 0; } #else /* CONFIG_SCHED_HMP */ #define sched_enable_power_aware 0 Loading Loading @@ -2477,6 +2489,12 @@ static inline int is_cpu_throttling_imminent(int cpu) return 0; } unsigned int cpu_temp(int cpu) { return 0; } #endif /* CONFIG_SCHED_HMP */ #ifdef CONFIG_SCHED_HMP Loading Loading @@ -5977,7 +5995,8 @@ static inline void update_sg_lb_stats(struct lb_env *env, trace_sched_cpu_load(cpu_rq(i), idle_cpu(i), mostly_idle_cpu(i), sched_irqload(i), power_cost_at_freq(i, 0)); power_cost_at_freq(i, 0), cpu_temp(i)); nr_running = rq->nr_running; /* Bias balancing toward cpus of our domain */ Loading kernel/sched/rt.c +1 −1 Original line number Diff line number Diff line Loading @@ -1555,7 +1555,7 @@ static int find_lowest_rq_hmp(struct task_struct *task) struct rq *rq = cpu_rq(i); cpu_cost = power_cost_at_freq(i, ACCESS_ONCE(rq->min_freq)); trace_sched_cpu_load(rq, idle_cpu(i), mostly_idle_cpu(i), sched_irqload(i), cpu_cost); sched_irqload(i), cpu_cost, cpu_temp(i)); if (sched_boost() && capacity(rq) != max_capacity) continue; Loading kernel/sched/sched.h +1 −0 Original line number Diff line number Diff line Loading @@ -734,6 +734,7 @@ u64 scale_load_to_cpu(u64 load, int cpu); unsigned int max_task_load(void); extern void sched_account_irqtime(int cpu, struct task_struct *curr, u64 delta, u64 wallclock); unsigned int cpu_temp(int cpu); static inline int capacity(struct rq *rq) { Loading Loading
Documentation/scheduler/sched-hmp.txt +2 −1 Original line number Diff line number Diff line Loading @@ -1321,7 +1321,7 @@ Logged when selecting the best CPU to run a task (select_best_cpu() for fair class tasks, find_lowest_rq_hmp() for RT tasks) and load balancing (update_sg_lb_stats()). <idle>-0 [004] d.h3 12700.711541: sched_cpu_load: cpu 0 idle 1 mostly_idle 1 nr_run 0 nr_big 0 nr_small 0 lsf 1945 capacity 1045 cr_avg 0 irqload 4456 fcur 199200 fmax 940800 power_cost 1045 cstate 1 <idle>-0 [004] d.h3 12700.711541: sched_cpu_load: cpu 0 idle 1 mostly_idle 1 nr_run 0 nr_big 0 nr_small 0 lsf 1945 capacity 1045 cr_avg 0 irqload 4456 fcur 199200 fmax 940800 power_cost 1045 cstate 1 temp 73 - cpu: the CPU being described - idle: boolean indicating whether the CPU is idle Loading @@ -1339,6 +1339,7 @@ class tasks, find_lowest_rq_hmp() for RT tasks) and load balancing - fmax: max CPU frequency (but not maximum _possible_ frequency) (KHz) - power_cost: cost of running this CPU at the current frequency - cstate: current cstate of CPU - temp: current temperature of the CPU The power_cost value above differs in how it is calculated depending on the callsite of this tracepoint. The select_best_cpu() call to this tracepoint Loading
include/trace/events/sched.h +6 −4 Original line number Diff line number Diff line Loading @@ -159,9 +159,9 @@ TRACE_EVENT(sched_task_load, TRACE_EVENT(sched_cpu_load, TP_PROTO(struct rq *rq, int idle, int mostly_idle, u64 irqload, unsigned int power_cost), unsigned int power_cost, int temp), TP_ARGS(rq, idle, mostly_idle, irqload, power_cost), TP_ARGS(rq, idle, mostly_idle, irqload, power_cost, temp), TP_STRUCT__entry( __field(unsigned int, cpu ) Loading @@ -178,6 +178,7 @@ TRACE_EVENT(sched_cpu_load, __field(unsigned int, max_freq ) __field(unsigned int, power_cost ) __field( int, cstate ) __field( int, temp ) ), TP_fast_assign( Loading @@ -195,15 +196,16 @@ TRACE_EVENT(sched_cpu_load, __entry->max_freq = rq->max_freq; __entry->power_cost = power_cost; __entry->cstate = rq->cstate; __entry->temp = temp; ), TP_printk("cpu %u idle %d mostly_idle %d nr_run %u nr_big %u nr_small %u lsf %u capacity %u cr_avg %llu irqload %llu fcur %u fmax %u power_cost %u cstate %d", TP_printk("cpu %u idle %d mostly_idle %d nr_run %u nr_big %u nr_small %u lsf %u capacity %u cr_avg %llu irqload %llu fcur %u fmax %u power_cost %u cstate %d temp %d", __entry->cpu, __entry->idle, __entry->mostly_idle, __entry->nr_running, __entry->nr_big_tasks, __entry->nr_small_tasks, __entry->load_scale_factor, __entry->capacity, __entry->cumulative_runnable_avg, __entry->irqload, __entry->cur_freq, __entry->max_freq, __entry->power_cost, __entry->cstate) __entry->power_cost, __entry->cstate, __entry->temp) ); TRACE_EVENT(sched_set_boost, Loading
kernel/sched/fair.c +22 −3 Original line number Diff line number Diff line Loading @@ -1775,7 +1775,8 @@ static int best_small_task_cpu(struct task_struct *p, int sync) trace_sched_cpu_load(cpu_rq(i), idle_cpu(i), mostly_idle_cpu_sync(i, sync), sched_irqload(i), power_cost(p, i)); sched_irqload(i), power_cost(p, i), cpu_temp(i)); cpu_cost = power_cost(p, i); if (cpu_cost < min_cost) { Loading Loading @@ -1930,7 +1931,8 @@ static int select_best_cpu(struct task_struct *p, int target, int reason, trace_sched_cpu_load(cpu_rq(i), idle_cpu(i), mostly_idle_cpu_sync(i, sync), sched_irqload(i), power_cost(p, i)); sched_irqload(i), power_cost(p, i), cpu_temp(i)); if (skip_cpu(p, i, reason)) continue; Loading Loading @@ -2416,6 +2418,16 @@ static inline int is_cpu_throttling_imminent(int cpu) return throttling; } unsigned int cpu_temp(int cpu) { struct cpu_pwr_stats *per_cpu_info = get_cpu_pwr_stats(); if (per_cpu_info) return per_cpu_info[cpu].temp; else return 0; } #else /* CONFIG_SCHED_HMP */ #define sched_enable_power_aware 0 Loading Loading @@ -2477,6 +2489,12 @@ static inline int is_cpu_throttling_imminent(int cpu) return 0; } unsigned int cpu_temp(int cpu) { return 0; } #endif /* CONFIG_SCHED_HMP */ #ifdef CONFIG_SCHED_HMP Loading Loading @@ -5977,7 +5995,8 @@ static inline void update_sg_lb_stats(struct lb_env *env, trace_sched_cpu_load(cpu_rq(i), idle_cpu(i), mostly_idle_cpu(i), sched_irqload(i), power_cost_at_freq(i, 0)); power_cost_at_freq(i, 0), cpu_temp(i)); nr_running = rq->nr_running; /* Bias balancing toward cpus of our domain */ Loading
kernel/sched/rt.c +1 −1 Original line number Diff line number Diff line Loading @@ -1555,7 +1555,7 @@ static int find_lowest_rq_hmp(struct task_struct *task) struct rq *rq = cpu_rq(i); cpu_cost = power_cost_at_freq(i, ACCESS_ONCE(rq->min_freq)); trace_sched_cpu_load(rq, idle_cpu(i), mostly_idle_cpu(i), sched_irqload(i), cpu_cost); sched_irqload(i), cpu_cost, cpu_temp(i)); if (sched_boost() && capacity(rq) != max_capacity) continue; Loading
kernel/sched/sched.h +1 −0 Original line number Diff line number Diff line Loading @@ -734,6 +734,7 @@ u64 scale_load_to_cpu(u64 load, int cpu); unsigned int max_task_load(void); extern void sched_account_irqtime(int cpu, struct task_struct *curr, u64 delta, u64 wallclock); unsigned int cpu_temp(int cpu); static inline int capacity(struct rq *rq) { Loading