kernel: Add snapshot of changes to support cpu isolation

This snapshot is taken from msm-4.19 as of commit 5debecbe7195
("trace: filter out spurious preemption and IRQs disable traces").

Change-Id: I222aa448ac68f7365065f62dba9db94925da38a0
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
This commit is contained in:
Satya Durga Srinivasu Prabhala 2019-09-17 10:34:18 -07:00
commit 201ea48219
20 changed files with 398 additions and 77 deletions

View file

@ -2014,7 +2014,7 @@ int hrtimers_prepare_cpu(unsigned int cpu)
return 0;
}
#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_CPUSETS)
#ifdef CONFIG_HOTPLUG_CPU
static void migrate_hrtimer_list(struct hrtimer_clock_base *old_base,
struct hrtimer_clock_base *new_base,
bool remove_pinned)
@ -2023,12 +2023,14 @@ static void migrate_hrtimer_list(struct hrtimer_clock_base *old_base,
struct timerqueue_node *node;
struct timerqueue_head pinned;
int is_pinned;
bool is_hotplug = !cpu_online(old_base->cpu_base->cpu);
timerqueue_init_head(&pinned);
while ((node = timerqueue_getnext(&old_base->active))) {
timer = container_of(node, struct hrtimer, node);
BUG_ON(hrtimer_callback_running(timer));
if (is_hotplug)
BUG_ON(hrtimer_callback_running(timer));
debug_deactivate(timer);
/*
@ -2106,9 +2108,7 @@ static void __migrate_hrtimers(unsigned int scpu, bool remove_pinned)
local_irq_restore(flags);
local_bh_enable();
}
#endif /* CONFIG_HOTPLUG_CPU || CONFIG_CPUSETS */
#ifdef CONFIG_HOTPLUG_CPU
int hrtimers_dead_cpu(unsigned int scpu)
{
BUG_ON(cpu_online(scpu));
@ -2117,14 +2117,13 @@ int hrtimers_dead_cpu(unsigned int scpu)
__migrate_hrtimers(scpu, true);
return 0;
}
#endif /* CONFIG_HOTPLUG_CPU */
#ifdef CONFIG_CPUSETS
void hrtimer_quiesce_cpu(void *cpup)
{
__migrate_hrtimers(*(int *)cpup, false);
}
#endif /* CONFIG_CPUSETS */
#endif /* CONFIG_HOTPLUG_CPU */
void __init hrtimers_init(void)
{

View file

@ -2038,7 +2038,8 @@ static void __migrate_timers(unsigned int cpu, bool remove_pinned)
*/
forward_timer_base(new_base);
BUG_ON(old_base->running_timer);
if (!cpu_online(cpu))
BUG_ON(old_base->running_timer);
for (i = 0; i < WHEEL_SIZE; i++)
migrate_timer_list(new_base, old_base->vectors + i,
@ -2057,12 +2058,10 @@ int timers_dead_cpu(unsigned int cpu)
return 0;
}
#ifdef CONFIG_CPUSETS
void timer_quiesce_cpu(void *cpup)
{
__migrate_timers(*(unsigned int *)cpup, false);
}
#endif /* CONFIG_CPUSETS */
#endif /* CONFIG_HOTPLUG_CPU */