Merge tag 'tag-chrome-platform-fixes-for-v5.7-rc2' of git://git.kernel.org/pub/scm...
[linux-block.git] / kernel / sched / cpupri.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
6e0534f2 2
e539d8fc 3#define CPUPRI_NR_PRIORITIES (MAX_RT_PRIO + 2)
6e0534f2 4
97fb7a0a
IM
5#define CPUPRI_INVALID -1
6#define CPUPRI_IDLE 0
7#define CPUPRI_NORMAL 1
6e0534f2
GH
8/* values 2-101 are RT priorities 0-99 */
9
10struct cpupri_vec {
97fb7a0a
IM
11 atomic_t count;
12 cpumask_var_t mask;
6e0534f2
GH
13};
14
15struct cpupri {
97fb7a0a
IM
16 struct cpupri_vec pri_to_cpu[CPUPRI_NR_PRIORITIES];
17 int *cpu_to_pri;
6e0534f2
GH
18};
19
20#ifdef CONFIG_SMP
804d402f 21int cpupri_find(struct cpupri *cp, struct task_struct *p,
a1bd02e1
QY
22 struct cpumask *lowest_mask);
23int cpupri_find_fitness(struct cpupri *cp, struct task_struct *p,
24 struct cpumask *lowest_mask,
25 bool (*fitness_fn)(struct task_struct *p, int cpu));
6e0534f2 26void cpupri_set(struct cpupri *cp, int cpu, int pri);
97fb7a0a 27int cpupri_init(struct cpupri *cp);
68e74568 28void cpupri_cleanup(struct cpupri *cp);
6e0534f2 29#endif