Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Juri Lelli | 6bfd6d7 | 2013-11-07 14:43:47 +0100 | [diff] [blame] | 2 | |
Ingo Molnar | 97fb7a0 | 2018-03-03 14:01:12 +0100 | [diff] [blame] | 3 | #define IDX_INVALID -1 |
Juri Lelli | 6bfd6d7 | 2013-11-07 14:43:47 +0100 | [diff] [blame] | 4 | |
Peter Zijlstra | 944770a | 2014-05-14 16:13:56 +0200 | [diff] [blame] | 5 | struct cpudl_item { |
Ingo Molnar | 97fb7a0 | 2018-03-03 14:01:12 +0100 | [diff] [blame] | 6 | u64 dl; |
| 7 | int cpu; |
| 8 | int idx; |
Juri Lelli | 6bfd6d7 | 2013-11-07 14:43:47 +0100 | [diff] [blame] | 9 | }; |
| 10 | |
| 11 | struct cpudl { |
Ingo Molnar | 97fb7a0 | 2018-03-03 14:01:12 +0100 | [diff] [blame] | 12 | raw_spinlock_t lock; |
| 13 | int size; |
| 14 | cpumask_var_t free_cpus; |
| 15 | struct cpudl_item *elements; |
Juri Lelli | 6bfd6d7 | 2013-11-07 14:43:47 +0100 | [diff] [blame] | 16 | }; |
| 17 | |
Juri Lelli | 6bfd6d7 | 2013-11-07 14:43:47 +0100 | [diff] [blame] | 18 | #ifdef CONFIG_SMP |
Ingo Molnar | 97fb7a0 | 2018-03-03 14:01:12 +0100 | [diff] [blame] | 19 | int cpudl_find(struct cpudl *cp, struct task_struct *p, struct cpumask *later_mask); |
Tommaso Cucinotta | d8206bb | 2016-08-14 16:27:08 +0200 | [diff] [blame] | 20 | void cpudl_set(struct cpudl *cp, int cpu, u64 dl); |
| 21 | void cpudl_clear(struct cpudl *cp, int cpu); |
Ingo Molnar | 97fb7a0 | 2018-03-03 14:01:12 +0100 | [diff] [blame] | 22 | int cpudl_init(struct cpudl *cp); |
Xunlei Pang | 16b2694 | 2015-01-19 04:49:36 +0000 | [diff] [blame] | 23 | void cpudl_set_freecpu(struct cpudl *cp, int cpu); |
| 24 | void cpudl_clear_freecpu(struct cpudl *cp, int cpu); |
Juri Lelli | 6bfd6d7 | 2013-11-07 14:43:47 +0100 | [diff] [blame] | 25 | void cpudl_cleanup(struct cpudl *cp); |
Juri Lelli | 6bfd6d7 | 2013-11-07 14:43:47 +0100 | [diff] [blame] | 26 | #endif /* CONFIG_SMP */ |