blob: de7edac4367417c7de26e3568876d5705be77859 [file] [log] [blame]
Srivatsa Vaddagiri26c21542016-05-31 09:08:38 -07001/*
2 * Copyright (c) 2016, The Linux Foundation. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
14#ifndef __WALT_H
15#define __WALT_H
16
17#ifdef CONFIG_SCHED_WALT
18
19void walt_update_task_ravg(struct task_struct *p, struct rq *rq, int event,
20 u64 wallclock, u64 irqtime);
21void walt_inc_cumulative_runnable_avg(struct rq *rq, struct task_struct *p);
22void walt_dec_cumulative_runnable_avg(struct rq *rq, struct task_struct *p);
23void walt_inc_cfs_cumulative_runnable_avg(struct cfs_rq *rq,
24 struct task_struct *p);
25void walt_dec_cfs_cumulative_runnable_avg(struct cfs_rq *rq,
26 struct task_struct *p);
27void walt_fixup_busy_time(struct task_struct *p, int new_cpu);
28void walt_init_new_task_load(struct task_struct *p);
29void walt_mark_task_starting(struct task_struct *p);
30void walt_set_window_start(struct rq *rq);
31void walt_migrate_sync_cpu(int cpu);
32void walt_init_cpu_efficiency(void);
33u64 walt_ktime_clock(void);
Srinath Sridharan3a73c962016-07-22 13:21:15 +010034void walt_account_irqtime(int cpu, struct task_struct *curr, u64 delta,
35 u64 wallclock);
36
37u64 walt_irqload(int cpu);
38int walt_cpu_high_irqload(int cpu);
Srivatsa Vaddagiri26c21542016-05-31 09:08:38 -070039
40#else /* CONFIG_SCHED_WALT */
41
42static inline void walt_update_task_ravg(struct task_struct *p, struct rq *rq,
43 int event, u64 wallclock, u64 irqtime) { }
44static inline void walt_inc_cumulative_runnable_avg(struct rq *rq, struct task_struct *p) { }
45static inline void walt_dec_cumulative_runnable_avg(struct rq *rq, struct task_struct *p) { }
46static inline void walt_inc_cfs_cumulative_runnable_avg(struct cfs_rq *rq,
47 struct task_struct *p) { }
48static inline void walt_dec_cfs_cumulative_runnable_avg(struct cfs_rq *rq,
49 struct task_struct *p) { }
50static inline void walt_fixup_busy_time(struct task_struct *p, int new_cpu) { }
51static inline void walt_init_new_task_load(struct task_struct *p) { }
52static inline void walt_mark_task_starting(struct task_struct *p) { }
53static inline void walt_set_window_start(struct rq *rq) { }
54static inline void walt_migrate_sync_cpu(int cpu) { }
55static inline void walt_init_cpu_efficiency(void) { }
56static inline u64 walt_ktime_clock(void) { return 0; }
57
Patrick Bellasi56e27192017-03-29 09:01:06 +010058#define walt_cpu_high_irqload(cpu) false
59
Srivatsa Vaddagiri26c21542016-05-31 09:08:38 -070060#endif /* CONFIG_SCHED_WALT */
61
Vikram Mulukutla44310bf2017-08-10 17:26:20 -070062extern bool walt_disabled;
Srivatsa Vaddagiri26c21542016-05-31 09:08:38 -070063
64#endif