[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFw-dSLHevtTWtmtR+HRpzRGEHzQxC6nrMnM-oYgmvi7Qg@mail.gmail.com>
Date: Mon, 14 Sep 2015 16:58:21 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Sasha Levin <sasha.levin@...cle.com>, wanpeng.li@...mail.com,
Peter Anvin <hpa@...or.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Huang Ying <ying.huang@...el.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Thomas Gleixner <tglx@...utronix.de>
Cc: "linux-tip-commits@...r.kernel.org"
<linux-tip-commits@...r.kernel.org>
Subject: Re: [tip:sched/core] sched: 'Annotate' migrate_tasks()
On Sun, Sep 13, 2015 at 3:56 AM, tip-bot for Wanpeng Li
<tipbot@...or.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.
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists