public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Paul Mackerras <paulus@samba.org>
Cc: LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Stephane Eranian <eranian@google.com>,
	Will Deacon <will.deacon@arm.com>,
	Paul Mundt <lethal@linux-sh.org>,
	David Miller <davem@davemloft.net>,
	Borislav Petkov <bp@amd64.org>
Subject: Re: [RFC PATCH 5/6 v4] perf: Fix race in callchains
Date: Wed, 18 Aug 2010 05:49:46 +0200	[thread overview]
Message-ID: <20100818034943.GB24748@nowhere> (raw)
In-Reply-To: <20100817045331.GE24726@drongo>

On Tue, Aug 17, 2010 at 02:53:31PM +1000, Paul Mackerras wrote:
> On Tue, Aug 17, 2010 at 03:34:06AM +0200, Frederic Weisbecker wrote:
> 
> > Now that software events don't have interrupt disabled anymore in
> > the event path, callchains can nest on any context. So seperating
> > nmi and others contexts in two buffers has become racy.
> > 
> > Fix this by providing one buffer per nesting level. Given the size
> > of the callchain entries (2040 bytes * 4), we now need to allocate
> > them dynamically.
> > 
> > v2: Fixed put_callchain_entry call after recursion.
> >     Fix the type of the recursion, it must be an array.
> > 
> > v3: Use a manual pr cpu allocation (temporary solution until NMIs
> >     can safely access vmalloc'ed memory).
> 
> It would be nice to make these allocations node-local.


You're right, I'll use kmalloc_node then.

 
> Also, I see that we're allocating 4 buffers per cpu on powerpc when we
> strictly only need 3, but I don't suppose that really matters.


Yeah, we are allocating a similar per-context bunch of buffers for trace
events and also for software events.

If we had a way to know if an arch has nmis, we could manage that.
Whenever this is about simulated or really unmaskable, we don't care,
we just need to know if events can nest on traditional irq disabled
sections.

How do you deal with that in PPC? Is the event delayed to when irqs are
restored?


  reply	other threads:[~2010-08-18  3:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-16 20:48 [RFC PATCH 0/0 v3] callchain fixes and cleanups Frederic Weisbecker
2010-08-16 20:48 ` [RFC PATCH 1/6] perf: Drop unappropriate tests on arch callchains Frederic Weisbecker
2010-08-16 20:48 ` [RFC PATCH 2/6] perf: Generalize callchain_store() Frederic Weisbecker
2010-08-17  4:37   ` Paul Mackerras
2010-08-16 20:48 ` [RFC PATCH 3/6] perf: Generalize some arch callchain code Frederic Weisbecker
2010-08-17  3:46   ` Paul Mackerras
2010-08-18  3:51     ` Frederic Weisbecker
2010-08-16 20:48 ` [RFC PATCH 4/6] perf: Factorize callchain context handling Frederic Weisbecker
2010-08-17  4:37   ` Paul Mackerras
2010-08-16 20:48 ` [RFC PATCH 5/6] perf: Fix race in callchains Frederic Weisbecker
2010-08-17  1:34   ` [RFC PATCH 5/6 v4] " Frederic Weisbecker
2010-08-17  4:53     ` Paul Mackerras
2010-08-18  3:49       ` Frederic Weisbecker [this message]
2010-08-16 20:48 ` [RFC PATCH 6/6] perf: Humanize the number of contexts Frederic Weisbecker
2010-08-17  4:58 ` [RFC PATCH 0/0 v3] callchain fixes and cleanups Borislav Petkov
2010-08-18  3:53   ` Frederic Weisbecker
2010-08-17 10:32 ` Will Deacon
2010-08-18  3:55   ` Frederic Weisbecker
2010-08-18  9:08     ` Will Deacon
2010-08-18 16:15       ` 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=20100818034943.GB24748@nowhere \
    --to=fweisbec@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=bp@amd64.org \
    --cc=davem@davemloft.net \
    --cc=eranian@google.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=will.deacon@arm.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