[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100123153346.GA16070@suse.de>
Date: Sat, 23 Jan 2010 07:33:46 -0800
From: Greg KH <gregkh@...e.de>
To: Stefan Bader <stefan.bader@...onical.com>
Cc: linux-kernel@...r.kernel.org, stable@...nel.org,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Ingo Molnar <mingo@...e.hu>, Paul Mackerras <paulus@...ba.org>,
akpm@...ux-foundation.org, torvalds@...ux-foundation.org,
stable-review@...nel.org, alan@...rguk.ukuu.org.uk
Subject: Re: [Stable-review] [28/29] perf events: Dont report side-band
events on each cpu for per-task-per-cpu events
On Sat, Jan 23, 2010 at 12:38:41PM +0100, Stefan Bader wrote:
> Greg KH wrote:
> > 2.6.32-stable review patch. If anyone has any objections, please let us know.
> >
> > ------------------
> >
> > From: Peter Zijlstra <a.p.zijlstra@...llo.nl>
> >
> > commit 5d27c23df09b702868d9a3bff86ec6abd22963ac upstream.
> >
> > Acme noticed that his FORK/MMAP numbers were inflated by about
> > the same factor as his cpu-count.
> >
> > This led to the discovery of a few more sites that need to
> > respect the event->cpu filter.
> >
> > Reported-by: Arnaldo Carvalho de Melo <acme@...stprotocols.net>
> > Signed-off-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
> > Cc: Paul Mackerras <paulus@...ba.org>
> > LKML-Reference: <20091217121830.215333434@...llo.nl>
> > Signed-off-by: Ingo Molnar <mingo@...e.hu>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>
> >
> > ---
> > kernel/perf_event.c | 20 ++++++++++++++++++--
> > 1 file changed, 18 insertions(+), 2 deletions(-)
> >
> > --- a/kernel/perf_event.c
> > +++ b/kernel/perf_event.c
> > @@ -1359,6 +1359,9 @@ static void perf_ctx_adjust_freq(struct
> > if (event->state != PERF_EVENT_STATE_ACTIVE)
> > continue;
> >
> > + if (event->cpu != -1 && event->cpu != smp_processor_id())
> > + continue;
> > +
> > hwc = &event->hw;
> >
> > interrupts = hwc->interrupts;
> > @@ -3226,6 +3229,9 @@ static void perf_event_task_output(struc
> >
> > static int perf_event_task_match(struct perf_event *event)
> > {
> > + if (event->cpu != -1 && event->cpu != smp_processor_id())
> > + return 0;
> > +
> > if (event->attr.comm || event->attr.mmap || event->attr.task)
> > return 1;
> >
>
> > @@ -3262,6 +3268,7 @@ static void perf_event_task_event(struct
> > ctx = rcu_dereference(task_event->task->perf_event_ctxp);
> > if (ctx)
> > perf_event_task_ctx(ctx, task_event);
> > + put_cpu_var(perf_cpu_context);
> > rcu_read_unlock();
> > }
>
> I believe this hunk drops the move of put_cpu_var. The upstream hunk looks like
> this:
>
> @ -3290,12 +3296,11 @@ static void perf_event_task_event(struct perf_task_event
> rcu_read_lock();
> cpuctx = &get_cpu_var(perf_cpu_context);
> perf_event_task_ctx(&cpuctx->ctx, task_event);
> - put_cpu_var(perf_cpu_context);
> -
> if (!ctx)
> ctx = rcu_dereference(task_event->task->perf_event_ctxp);
> if (ctx)
> perf_event_task_ctx(ctx, task_event);
> + put_cpu_var(perf_cpu_context);
> rcu_read_unlock();
> }
Good catch, thanks, I merged this by hand (it was needed by the patch
after this), and I missed this chunk.
thanks,
greg k-h
--
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