public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Like Xu <like.xu@linux.intel.com>
Cc: Kan Liang <kan.liang@linux.intel.com>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Borislav Petkov <bp@alien8.de>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND 2/2] perf/x86/lbr: Move cpuc->lbr_xsave allocation out of sleeping region
Date: Wed, 21 Apr 2021 11:21:09 +0200	[thread overview]
Message-ID: <YH/uhXEmQllOsIeK@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <13fd7ac4-46fd-3fa7-0e80-3f46cfc8edac@linux.intel.com>

On Wed, Apr 21, 2021 at 04:48:36PM +0800, Like Xu wrote:
> Hi Peter,
> 
> On 2021/4/21 16:38, Peter Zijlstra wrote:
> > On Wed, Apr 21, 2021 at 10:18:25AM +0800, Like Xu wrote:
> > > -int x86_reserve_hardware(void)
> > > +int x86_reserve_hardware(struct perf_event *event)
> > >   {
> > >   	int err = 0;
> > > @@ -398,8 +398,10 @@ int x86_reserve_hardware(void)
> > >   		if (atomic_read(&pmc_refcount) == 0) {
> > >   			if (!reserve_pmc_hardware())
> > >   				err = -EBUSY;
> > > -			else
> > > +			else {
> > >   				reserve_ds_buffers();
> > > +				reserve_lbr_buffers(event);
> > > +			}
> > >   		}
> > >   		if (!err)
> > >   			atomic_inc(&pmc_refcount);
> > > @@ -650,7 +652,7 @@ static int __x86_pmu_event_init(struct perf_event *event)
> > >   	if (!x86_pmu_initialized())
> > >   		return -ENODEV;
> > > -	err = x86_reserve_hardware();
> > > +	err = x86_reserve_hardware(event);
> > >   	if (err)
> > >   		return err;
> > 
> > This is still complete garbage..
> 
> Hhh,thanks for your comment!

The nice one was here:

  https://lkml.kernel.org/r/20210323214140.GE4746@worktop.programming.kicks-ass.net

> So do we have a better idea to alloc cpuc->lbr_xsave
> to avoid this kind of call trace ?

You thinking this is actually hard scares me. Frob something in
intel_pmu_hw_config() or thereabouts.

  reply	other threads:[~2021-04-21  9:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-21  2:18 [PATCH RESEND 1/2] perf/x86: Skip checking MSR for MSR 0x0 Like Xu
2021-04-21  2:18 ` [PATCH RESEND 2/2] perf/x86/lbr: Move cpuc->lbr_xsave allocation out of sleeping region Like Xu
2021-04-21  8:38   ` Peter Zijlstra
2021-04-21  8:48     ` Like Xu
2021-04-21  9:21       ` Peter Zijlstra [this message]
2021-04-21 15:30 ` [PATCH RESEND 1/2] perf/x86: Skip checking MSR for MSR 0x0 Sean Christopherson
2021-04-22  1:18   ` Like Xu
2021-04-22  1:38     ` Sean Christopherson

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=YH/uhXEmQllOsIeK@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=jolsa@redhat.com \
    --cc=kan.liang@linux.intel.com \
    --cc=like.xu@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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