> 
> >     CPU 0                           CPU 1
> >     -----                           -----
> >     [ wake up ]
> >                                  spin_lock(cpu1_rq->lock);
> >     spin_lock(cpu1_rq->lock)
> >                                 double_lock_balance()
> >                                 [ release cpu1_rq->lock ]
> >                                 spin_lock(cpu1_rq->lock)
> >     [due to ticket, now acquires
> >      cpu1_rq->lock ]
> > 
> >     [goes to push task]
> >     double_lock_balance()
> >     [ release cpu1_rq->lock ]
> >                                    [ acquires lock ]
> >                                spin_lock(cpu2_rq->lock)
> >                                [ blocks as cpu2 is using it ]
> >   
> 
> Also, its not entirely clear this scenario helps illustrate how your
> change is better; because here the lock _is_ contended, so we'll fail
> the trylock, no?

Sorry, I should have been more specific that the double lock balance
was grabbing cpu2_rq (another rq lock), where there was no contention.

-- Steve

Reply via email to