[PATCH 1/1] cpu: Add annotation inside clear_tasks_mm_cpumask()

From: Jules Irenge
Date: Wed Apr 15 2020 - 15:13:53 EST


Sparse reports a warning

warning: context imbalance in clear_tasks_mm_cpumask() - different lock contexts for basic block

The root cause is the missing annotation inside clear_tasks_mm_cpumask()

Add the missing __acquire(&t->alloc_lock) annotation.

Signed-off-by: Jules Irenge <jbi.octave@xxxxxxxxx>
---
kernel/cpu.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 9c706af713fb..d8c452a8dd09 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -834,6 +834,7 @@ void clear_tasks_mm_cpumask(int cpu)
t = find_lock_task_mm(p);
if (!t)
continue;
+ __acquire(&t->alloc_lock);
cpumask_clear_cpu(cpu, mm_cpumask(t->mm));
task_unlock(t);
}
--
2.24.1