lkml.org 
[lkml]   [2015]   [Sep]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [tip:sched/core] sched: 'Annotate' migrate_tasks()
On Mon, Sep 14, 2015 at 04:58:21PM -0700, Linus Torvalds wrote:
> On Sun, Sep 13, 2015 at 3:56 AM, tip-bot for Wanpeng Li
> <tipbot@zytor.com> wrote:
> > + lockdep_unpin_lock(&rq->lock);
> > + raw_spin_unlock(&rq->lock);
> > + raw_spin_lock(&next->pi_lock);
> > + raw_spin_lock(&rq->lock);
>
> So _if_ this is ever likely to be a performance-critical piece of
> code, it might be worth doing
>
> if (!raw_spin_trylock(&next->pi_lock)) {
> .. do the above unlock and relock in the right order sequence ..
> }
>
> to avoid doing that whole "unlock just to relock in the right order" thing.
>
> That's particularly true in cases where dropping one of the locks can
> necessitate re-doing some checks.

Correct, but this is the hot-unplug, migrate the few tasks that are now
on a dead CPU away path, so meh ;-)


\
 
 \ /
  Last update: 2015-09-15 10:01    [W:0.074 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site