Commit | Line | Data |
---|---|---|
78634061 FW |
1 | #ifndef _LINUX_SCHED_ISOLATION_H |
2 | #define _LINUX_SCHED_ISOLATION_H | |
3 | ||
4 | #include <linux/cpumask.h> | |
5 | #include <linux/init.h> | |
6 | #include <linux/tick.h> | |
7 | ||
8 | #ifdef CONFIG_NO_HZ_FULL | |
e179f5a0 | 9 | DECLARE_STATIC_KEY_FALSE(housekeeping_overriden); |
7e56a1cf FW |
10 | extern int housekeeping_any_cpu(void); |
11 | extern const struct cpumask *housekeeping_cpumask(void); | |
12 | extern void housekeeping_affine(struct task_struct *t); | |
13 | extern bool housekeeping_test_cpu(int cpu); | |
78634061 | 14 | extern void __init housekeeping_init(void); |
7e56a1cf | 15 | |
78634061 FW |
16 | #else |
17 | ||
18 | static inline int housekeeping_any_cpu(void) | |
19 | { | |
20 | return smp_processor_id(); | |
21 | } | |
22 | ||
78634061 FW |
23 | static inline const struct cpumask *housekeeping_cpumask(void) |
24 | { | |
78634061 FW |
25 | return cpu_possible_mask; |
26 | } | |
27 | ||
7e56a1cf FW |
28 | static inline void housekeeping_affine(struct task_struct *t) { } |
29 | static inline void housekeeping_init(void) { } | |
30 | #endif /* CONFIG_NO_HZ_FULL */ | |
31 | ||
78634061 FW |
32 | static inline bool is_housekeeping_cpu(int cpu) |
33 | { | |
34 | #ifdef CONFIG_NO_HZ_FULL | |
e179f5a0 | 35 | if (static_branch_unlikely(&housekeeping_overriden)) |
7e56a1cf | 36 | return housekeeping_test_cpu(cpu); |
78634061 FW |
37 | #endif |
38 | return true; | |
39 | } | |
40 | ||
78634061 | 41 | #endif /* _LINUX_SCHED_ISOLATION_H */ |