mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: "Metzger, Markus T" <markus.t.metzger@intel.com>
Cc: "hpa@zytor.com" <hpa@zytor.com>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-tip-commits@vger.kernel.org" 
	<linux-tip-commits@vger.kernel.org>
Subject: Re: [tip:tracing/hw-branch-tracing] tracing/hw-branch-tracing: convert bts-tracer mutex to a spinlock
Date: Wed, 25 Feb 2009 12:45:42 +0100	[thread overview]
Message-ID: <20090225114542.GA14279@elte.hu> (raw)
In-Reply-To: <928CFBE8E7CB0040959E56B4EA41A77E4A4C1FE3@irsmsx504.ger.corp.intel.com>


* Metzger, Markus T <markus.t.metzger@intel.com> wrote:

> >-----Original Message-----
> >From: Ingo Molnar [mailto:mingo@elte.hu]
> >Sent: Wednesday, February 25, 2009 12:11 PM
> >To: Metzger, Markus T
> >Cc: hpa@zytor.com; mingo@redhat.com; tglx@linutronix.de; linux-kernel@vger.kernel.org; linux-tip-
> >commits@vger.kernel.org
> 
> 
> >> And I assume you like the spinlock better than the
> >> get/put_online_cpus(), as well.
> >
> >yeah - and get/put_online_cpus is sleepable too, so it doesnt
> >really help unless i'm missing something ...
> 
> I suggested to use get/put_online_cpus() instead of the lock.
> 
> The hotplug code waits until the cpu_hotplug.refcount is zero
> and it holds the cpu_hotplug.lock during hotplug operations
> (see cpu_hotplug_begin/done()).
> 
> In turn, get_online_cpus() needs to grab the cpu_hotplug.lock
> to increment the cpu_hotplug.refcount.
> 
> Thus, we will use the cpu_hotplug.lock instead of our own lock.

... which, if you use it in the exact same spots as now still 
does a potential sleep with irqs disabled => bad.

We might be able to not take the hotplug lock in the affected 
codepath, but we should really not expand on the use of that 
lock and should make this code self-sufficient.

	Ingo

  reply	other threads:[~2009-02-25 11:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <tip-2d542cf34264ac92e9e7ac55c0b096b066d569d2@kernel.org>
2009-02-25  9:51 ` Metzger, Markus T
2009-02-25  9:58   ` Ingo Molnar
2009-02-25 10:08     ` Metzger, Markus T
2009-02-25 11:11       ` Ingo Molnar
2009-02-25 11:35         ` Metzger, Markus T
2009-02-25 11:45           ` Ingo Molnar [this message]
2009-02-25 11:49             ` Metzger, Markus T

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=20090225114542.GA14279@elte.hu \
    --to=mingo@elte.hu \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=markus.t.metzger@intel.com \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®