public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ingo Molnar <mingo@kernel.org>,
	Sasha Levin <sasha.levin@oracle.com>,
	wanpeng.li@hotmail.com, Peter Anvin <hpa@zytor.com>,
	Huang Ying <ying.huang@intel.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	"linux-tip-commits@vger.kernel.org" 
	<linux-tip-commits@vger.kernel.org>
Subject: Re: [tip:sched/core] sched: 'Annotate' migrate_tasks()
Date: Tue, 15 Sep 2015 09:57:41 +0200	[thread overview]
Message-ID: <20150915075741.GV16853@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <CA+55aFw-dSLHevtTWtmtR+HRpzRGEHzQxC6nrMnM-oYgmvi7Qg@mail.gmail.com>

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 ;-)

      reply	other threads:[~2015-09-15  7:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-28  6:55 [PATCH v3] sched: fix tsk->pi_lock isn't held when do_set_cpus_allowed() Wanpeng Li
2015-08-28 13:29 ` Peter Zijlstra
2015-08-28 13:58   ` Wanpeng Li
2015-09-01  6:11   ` Wanpeng Li
2015-09-13 10:56 ` [tip:sched/core] sched: 'Annotate' migrate_tasks() tip-bot for Wanpeng Li
2015-09-14 23:58   ` Linus Torvalds
2015-09-15  7:57     ` Peter Zijlstra [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150915075741.GV16853@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=sasha.levin@oracle.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=wanpeng.li@hotmail.com \
    --cc=ying.huang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox