1 #ifndef _LINUX_SCHED_ISOLATION_H
2 #define _LINUX_SCHED_ISOLATION_H
4 #include <linux/cpumask.h>
5 #include <linux/init.h>
6 #include <linux/tick.h>
21 #ifdef CONFIG_CPU_ISOLATION
22 DECLARE_STATIC_KEY_FALSE(housekeeping_overridden);
23 extern int housekeeping_any_cpu(enum hk_type type);
24 extern const struct cpumask *housekeeping_cpumask(enum hk_type type);
25 extern bool housekeeping_enabled(enum hk_type type);
26 extern void housekeeping_affine(struct task_struct *t, enum hk_type type);
27 extern bool housekeeping_test_cpu(int cpu, enum hk_type type);
28 extern void __init housekeeping_init(void);
32 static inline int housekeeping_any_cpu(enum hk_type type)
34 return smp_processor_id();
37 static inline const struct cpumask *housekeeping_cpumask(enum hk_type type)
39 return cpu_possible_mask;
42 static inline bool housekeeping_enabled(enum hk_type type)
47 static inline void housekeeping_affine(struct task_struct *t,
48 enum hk_type type) { }
50 static inline bool housekeeping_test_cpu(int cpu, enum hk_type type)
55 static inline void housekeeping_init(void) { }
56 #endif /* CONFIG_CPU_ISOLATION */
58 static inline bool housekeeping_cpu(int cpu, enum hk_type type)
60 #ifdef CONFIG_CPU_ISOLATION
61 if (static_branch_unlikely(&housekeeping_overridden))
62 return housekeeping_test_cpu(cpu, type);
67 static inline bool cpu_is_isolated(int cpu)
69 return !housekeeping_test_cpu(cpu, HK_TYPE_DOMAIN) ||
70 !housekeeping_test_cpu(cpu, HK_TYPE_TICK);
73 #endif /* _LINUX_SCHED_ISOLATION_H */