public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>, Lin Ming <ming.m.lin@intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Stephane Eranian <eranian@google.com>,
	Robert Richter <robert.richter@amd.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] x86,perf: Implement minimal P4 PMU driver v14
Date: Thu, 11 Mar 2010 22:38:00 +0100	[thread overview]
Message-ID: <1268343480.5037.145.camel@laptop> (raw)
In-Reply-To: <20100311213128.GE25162@lenovo>

On Fri, 2010-03-12 at 00:31 +0300, Cyrill Gorcunov wrote:
> On Thu, Mar 11, 2010 at 10:24:22PM +0100, Peter Zijlstra wrote:
> > On Fri, 2010-03-12 at 00:15 +0300, Cyrill Gorcunov wrote:
> > 
> > > Perhaps something like the patch below (tested with kvm)? With this patch
> > > we will actually waste ~4/8 bytes per PMU (intel,amd,p6) since this call
> > > hits on p4 only, so I think perhaps better to use one x86 scheduler hook
> > > instead of empty schedule_events() in PMU, hmm?
> > > ---
> > > 
> > > x86,perf: Fix NULL deref on not assigned x86_pmu
> > > 
> > > In case of not assigned x86_pmu and software events
> > > NULL dereference may being hit via x86_pmu::schedule_events
> > > method.
> > > 
> > > Fix it by calling x86_pmu::schedule_events only if we
> > > have one. Otherwise use general scheduler.
> > > 
> > > Also the former x86_schedule_events calls restored.
> > 
> > Hrm,.. not sure that makes sense, sure it might not crash anymore, but
> > its not making much sense to compute anything if we don't have an
> > initialized x86_pmu.
> > 
> > Doesn't adding something like:
> > 
> >   if (!x86_pmu_initialized())
> >    return;
> > 
> > to hw_perf_group_sched_in() make more sense? We seem to do that for all
> > these weak things except this one.
> > 
> 
> As far as I see it'll not update tstamp_running then (in x86_event_sched_in).
> Or I miss somethig?

Have it return 0 and it will fallback to defaults. Since there is no
initialized x86_pmu there's no point in doing anything x86 specific.


  reply	other threads:[~2010-03-11 21:38 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-10 18:31 [RFC] x86,perf: Implement minimal P4 PMU driver v14 Cyrill Gorcunov
2010-03-10 19:29 ` Robert Richter
2010-03-10 19:43   ` Cyrill Gorcunov
2010-03-11  2:32 ` Lin Ming
2010-03-11  4:12   ` Cyrill Gorcunov
2010-03-11 16:54   ` Cyrill Gorcunov
2010-03-11 18:16     ` Ingo Molnar
2010-03-11 18:29       ` Cyrill Gorcunov
2010-03-11 18:39       ` Ingo Molnar
2010-03-11 21:15         ` Cyrill Gorcunov
2010-03-11 21:24           ` Peter Zijlstra
2010-03-11 21:31             ` Cyrill Gorcunov
2010-03-11 21:38               ` Peter Zijlstra [this message]
2010-03-11 21:41                 ` Cyrill Gorcunov
2010-03-11 21:50                 ` Cyrill Gorcunov
2010-03-12  9:54                   ` [tip:perf/x86] x86, perf: Fix NULL deref on not assigned x86_pmu tip-bot for Cyrill Gorcunov
2010-03-11 18:33     ` [tip:perf/x86] perf, x86: Implement initial P4 PMU driver tip-bot for Cyrill Gorcunov
2010-03-16 16:07       ` Robert Richter
2010-03-16 16:23         ` Cyrill Gorcunov
2010-03-17  1:05           ` Lin Ming
2010-03-17  9:48         ` [tip:perf/core] perf, x86: Report error code that returned from x86_pmu.hw_config() tip-bot for Robert Richter

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=1268343480.5037.145.camel@laptop \
    --to=peterz@infradead.org \
    --cc=acme@redhat.com \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=gorcunov@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.m.lin@intel.com \
    --cc=mingo@elte.hu \
    --cc=robert.richter@amd.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