Re: [tip:sched/core] sched: 'Annotate' migrate_tasks()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Sep 13, 2015 at 3:56 AM, tip-bot for Wanpeng Li
<tipbot@xxxxxxxxx> 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.

              Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux