sched: Compile cpu_isolated_mask in SCHED_WALT only

cpu_isolated_mask can only be used when SCHED_WALT is enabled. The
addition of the cpu_isolated_mask causes ABI to break. Thus, compile
references to cpu_isolated_mask only when SCHED_WALT is enabled.

Change-Id: I0982f6431abca807168dbabc4aca74771819565c
Signed-off-by: Elliot Berman <[email protected]>
This commit is contained in:
Elliot Berman 2020-05-27 15:45:11 -07:00
commit 9f125adcf2
15 changed files with 17282 additions and 17192 deletions

View file

@ -58,7 +58,9 @@ static bool migrate_one_irq(struct irq_desc *desc)
const struct cpumask *affinity;
bool brokeaff = false;
int err;
#ifdef CONFIG_SCHED_WALT
struct cpumask available_cpus;
#endif
/*
* IRQ chip might be already torn down, but the irq descriptor is
@ -111,12 +113,16 @@ static bool migrate_one_irq(struct irq_desc *desc)
if (maskchip && chip->irq_mask)
chip->irq_mask(d);
#ifdef CONFIG_SCHED_WALT
cpumask_copy(&available_cpus, affinity);
cpumask_andnot(&available_cpus, &available_cpus, cpu_isolated_mask);
affinity = &available_cpus;
#endif
if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
#ifdef CONFIG_SCHED_WALT
const struct cpumask *default_affinity;
#endif
/*
* If the interrupt is managed, then shut it down and leave
@ -128,6 +134,7 @@ static bool migrate_one_irq(struct irq_desc *desc)
return false;
}
#ifdef CONFIG_SCHED_WALT
default_affinity = desc->affinity_hint ? : irq_default_affinity;
/*
* The order of preference for selecting a fallback CPU is
@ -155,6 +162,9 @@ static bool migrate_one_irq(struct irq_desc *desc)
* prepared mask while overriding the user affinity.
*/
affinity = cpumask_of(cpumask_any(affinity));
#else
affinity = cpu_online_mask;
#endif
brokeaff = true;
}
/*

View file

@ -154,10 +154,12 @@ static ssize_t write_irq_affinity(int type, struct file *file,
if (err)
goto free_cpumask;
#ifdef CONFIG_SCHED_WALT
if (cpumask_subset(new_value, cpu_isolated_mask)) {
err = -EINVAL;
goto free_cpumask;
}
#endif
/*
* Do not allow disabling IRQs completely - it's a too easy