From 8cf404403a00039b63859397e269b7fe26bd2bef Mon Sep 17 00:00:00 2001 From: Olav Haugan Date: Wed, 7 Dec 2016 16:36:14 -0800 Subject: [PATCH] sched/core: Fix race condition in clearing hmp request There is a race condition between clearing an HMP request for active migration and the actual active migration. Active migration can he half-way through doing the migration when the HMP request can be cleared by another core. Move clearing of HMP request to the stopper thread to avoid this. Change-Id: I6d73b8f246ae3754ab60984af198333fd284ae16 Signed-off-by: Olav Haugan --- kernel/sched/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index d59cae164431..13990fa6f9cf 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -5609,6 +5609,7 @@ int do_isolation_work_cpu_stop(void *data) */ nohz_balance_clear_nohz_mask(cpu); + clear_hmp_request(cpu); local_irq_enable(); return 0; } @@ -5733,7 +5734,6 @@ int sched_isolate_cpu(int cpu) migrate_sync_cpu(cpu, cpumask_first(&avail_cpus)); stop_cpus(cpumask_of(cpu), do_isolation_work_cpu_stop, 0); - clear_hmp_request(cpu); calc_load_migrate(rq); update_max_interval(); -- 2.11.0