diff options
author | Prasad Sodagudi <psodagud@codeaurora.org> | 2019-03-15 11:52:48 -0700 |
---|---|---|
committer | Georg Veichtlbauer <georg@vware.at> | 2023-07-16 13:07:01 +0200 |
commit | daaa5da96a74d35c64db2952add990213355ab4a (patch) | |
tree | ad6b54285f04527927bc6a259f708dc31c30190c | |
parent | 217ab2d0ef91df5539f055c07a7890153c5ce9a2 (diff) |
sched: Take irq_sparse lock during the isolation
irq_migrate_all_off_this_cpu() is used to migrate IRQs and this
function checks for all active irq in the allocated_irqs mask.
irq_migrate_all_off_this_cpu() expects the caller to take irq_sparse
lock to avoid race conditions while accessing allocated_irqs
mask variable. Prevent a race between irq alloc/free and irq
migration by adding irq_sparse lock across CPU isolation.
Change-Id: I9edece1ecea45297c8f6529952d88b3133046467
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
-rw-r--r-- | kernel/sched/core.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 17c13347d703..61a80b81afcf 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6024,7 +6024,9 @@ int sched_isolate_cpu(int cpu) smp_call_function_any(&avail_cpus, hrtimer_quiesce_cpu, &cpu, 1); smp_call_function_any(&avail_cpus, timer_quiesce_cpu, &cpu, 1); + irq_lock_sparse(); stop_cpus(cpumask_of(cpu), do_isolation_work_cpu_stop, 0); + irq_unlock_sparse(); calc_load_migrate(rq); update_max_interval(); |