public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Robert Richter <robert.richter@amd.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"oprofile-list@lists.sourceforge.net"
	<oprofile-list@lists.sourceforge.net>,
	"Peter Zijlstra" <a.p.zijlstra@chello.nl>,
	"Frédéric Weisbecker" <fweisbec@gmail.com>
Subject: Re: [GIT PULL] oprofile fixes for v2.6.37
Date: Thu, 30 Dec 2010 18:38:47 +0100	[thread overview]
Message-ID: <20101230173847.GA2734@elte.hu> (raw)
In-Reply-To: <20101230130853.GA21073@erda.amd.com>


* Robert Richter <robert.richter@amd.com> wrote:

> On 29.12.10 11:37:43, Ingo Molnar wrote:
> 
> > Hm, i'm not sure this fix is correct:
> > 
> >  static int op_amd_init(struct oprofile_operations *ops)
> >  {
> > +       /*
> > +        * init_ibs() preforms implictly cpu-local operations, so pin this
> > +        * thread to its current CPU
> > +        */
> > +       preempt_disable();
> >         init_ibs();
> > +       preempt_enable();
> > 
> > If init_ibs() is indeed CPU local, then it needs to be called on all CPUs. Does 
> > that happen and if not why not? AFAICS it's only called on one CPU.
> 
> It is correct to run init_ibs() only on one cpu.  It only checks the ibs 
> capabilities and sets up pci devices (if necessary). It runs only on one cpu but 
> operates with the local APIC and some MSRs, thus it is better to disable 
> preemption.

Ok, but in that case the prempt_disable()/enable() should be put into init_ibs(), 
not be open-coded at the caller like that.

The comment about its cpu-localness could move to init_ibs() as well.

Thanks,

	Ingo

  reply	other threads:[~2010-12-30 17:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-29 14:47 [GIT PULL] oprofile fixes for v2.6.37 Robert Richter
2010-12-29 16:37 ` Ingo Molnar
2010-12-30 13:08   ` Robert Richter
2010-12-30 17:38     ` Ingo Molnar [this message]
2011-01-03 11:15       ` [PATCH] arch/x86/oprofile/op_model_amd.c: perform initialisation on a single CPU Robert Richter
2011-01-03 12:03         ` Ingo Molnar
2011-01-03 14:44           ` Robert Richter
  -- strict thread matches above, loose matches on Subject: below --
2010-10-29 10:04 [GIT PULL] oprofile fixes for v2.6.37 Robert Richter
2010-10-29 10:57 ` Ingo Molnar

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=20101230173847.GA2734@elte.hu \
    --to=mingo@elte.hu \
    --cc=a.p.zijlstra@chello.nl \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oprofile-list@lists.sourceforge.net \
    --cc=robert.richter@amd.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