Re: [RFC][PATCH 12/17] sched: Also serialize ttwu_local() withp->pi_lock

From: Tejun Heo
Date: Sun Jan 09 2011 - 18:11:50 EST


Hello,

On Mon, Jan 03, 2011 at 06:32:54PM +0100, Oleg Nesterov wrote:
> > @@ -2523,16 +2523,21 @@ static void try_to_wake_up_local(struct
> >
> > BUG_ON(rq != this_rq());
> > BUG_ON(p == current);
> > - lockdep_assert_held(&rq->lock);
> > +
> > + raw_spin_unlock(&rq->lock);
> > + raw_spin_lock(&p->pi_lock);
> > + raw_spin_lock(&rq->lock);
>
> I _think_ this is safe, this worker can't change cpu afaics. But
> probably Tejun can take a look, just in case.

Yeah, preemption is disabled so it should be safe. Only bound workers
can be woken up by ttwu_local. They get migrated to another CPU only
during CPU offlining. Both CPU offlining and task exit wouldn't
happen while preemption is disabled so it should be safe.

Thanks.

--
tejun
--
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/