diff options
Diffstat (limited to 'kernel/sched/isolation.c')
-rw-r--r-- | kernel/sched/isolation.c | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c index 3589252ed476..16445097eb25 100644 --- a/kernel/sched/isolation.c +++ b/kernel/sched/isolation.c | |||
@@ -11,7 +11,41 @@ | |||
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
13 | 13 | ||
14 | cpumask_var_t housekeeping_mask; | 14 | static cpumask_var_t housekeeping_mask; |
15 | |||
16 | int housekeeping_any_cpu(void) | ||
17 | { | ||
18 | if (tick_nohz_full_enabled()) | ||
19 | return cpumask_any_and(housekeeping_mask, cpu_online_mask); | ||
20 | |||
21 | return smp_processor_id(); | ||
22 | } | ||
23 | EXPORT_SYMBOL_GPL(housekeeping_any_cpu); | ||
24 | |||
25 | const struct cpumask *housekeeping_cpumask(void) | ||
26 | { | ||
27 | if (tick_nohz_full_enabled()) | ||
28 | return housekeeping_mask; | ||
29 | |||
30 | return cpu_possible_mask; | ||
31 | } | ||
32 | EXPORT_SYMBOL_GPL(housekeeping_cpumask); | ||
33 | |||
34 | void housekeeping_affine(struct task_struct *t) | ||
35 | { | ||
36 | if (tick_nohz_full_enabled()) | ||
37 | set_cpus_allowed_ptr(t, housekeeping_mask); | ||
38 | } | ||
39 | EXPORT_SYMBOL_GPL(housekeeping_affine); | ||
40 | |||
41 | bool housekeeping_test_cpu(int cpu) | ||
42 | { | ||
43 | if (tick_nohz_full_enabled()) | ||
44 | return cpumask_test_cpu(cpu, housekeeping_mask); | ||
45 | |||
46 | return true; | ||
47 | } | ||
48 | EXPORT_SYMBOL_GPL(housekeeping_test_cpu); | ||
15 | 49 | ||
16 | void __init housekeeping_init(void) | 50 | void __init housekeeping_init(void) |
17 | { | 51 | { |