blob: f7da8c55bba03261002c1b8d000233c8dd190a55 [file] [log] [blame]
Juri Lelli6bfd6d72013-11-07 14:43:47 +01001#ifndef _LINUX_CPUDL_H
2#define _LINUX_CPUDL_H
3
4#include <linux/sched.h>
Juri Lelli2726d6c2015-09-02 11:01:34 +01005#include <linux/sched/deadline.h>
Juri Lelli6bfd6d72013-11-07 14:43:47 +01006
7#define IDX_INVALID -1
8
Peter Zijlstra944770a2014-05-14 16:13:56 +02009struct cpudl_item {
Juri Lelli6bfd6d72013-11-07 14:43:47 +010010 u64 dl;
11 int cpu;
Peter Zijlstra944770a2014-05-14 16:13:56 +020012 int idx;
Juri Lelli6bfd6d72013-11-07 14:43:47 +010013};
14
15struct cpudl {
16 raw_spinlock_t lock;
17 int size;
Juri Lelli6bfd6d72013-11-07 14:43:47 +010018 cpumask_var_t free_cpus;
Peter Zijlstra944770a2014-05-14 16:13:56 +020019 struct cpudl_item *elements;
Juri Lelli6bfd6d72013-11-07 14:43:47 +010020};
21
22
23#ifdef CONFIG_SMP
24int cpudl_find(struct cpudl *cp, struct task_struct *p,
25 struct cpumask *later_mask);
Tommaso Cucinottad8206bb2016-08-14 16:27:08 +020026void cpudl_set(struct cpudl *cp, int cpu, u64 dl);
27void cpudl_clear(struct cpudl *cp, int cpu);
Juri Lelli6bfd6d72013-11-07 14:43:47 +010028int cpudl_init(struct cpudl *cp);
Xunlei Pang16b26942015-01-19 04:49:36 +000029void cpudl_set_freecpu(struct cpudl *cp, int cpu);
30void cpudl_clear_freecpu(struct cpudl *cp, int cpu);
Juri Lelli6bfd6d72013-11-07 14:43:47 +010031void cpudl_cleanup(struct cpudl *cp);
Juri Lelli6bfd6d72013-11-07 14:43:47 +010032#endif /* CONFIG_SMP */
33
34#endif /* _LINUX_CPUDL_H */