Re: [PATCH] sched: fix tsk->pi_lock isn't held when do_set_cpus_allowed()

From: Ingo Molnar
Date: Tue Aug 25 2015 - 04:31:11 EST



* Wanpeng Li <wanpeng.li@xxxxxxxxxxx> wrote:

> >>--- a/kernel/cpuset.c
> >>+++ b/kernel/cpuset.c
> >>@@ -2376,8 +2376,12 @@ void cpuset_cpus_allowed(struct task_struct *tsk, struct cpumask *pmask)
> >> void cpuset_cpus_allowed_fallback(struct task_struct *tsk)
> >> {
> >>+ unsigned long flags;
> >>+
> >> rcu_read_lock();
> >>+ raw_spin_lock_irqsave(&tsk->pi_lock, flags);
> >> do_set_cpus_allowed(tsk, task_cs(tsk)->effective_cpus);
> >>+ raw_spin_lock_irqsave(&tsk->pi_lock, flags);
> >Just curious, Will introduce deadlock after acquire lock twice? ;)
>
> Could you point out where acquires lock twice?

In the code you quote?

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/