public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Stephane Eranian <eranian@google.com>
Cc: David Rientjes <rientjes@google.com>,
	Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>, x86 <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [patch] x86, perf: avoid spamming kernel log for bts buffer failure
Date: Wed, 2 Jul 2014 15:31:05 +0200	[thread overview]
Message-ID: <20140702133105.GG19379@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <CABPqkBT9zT6Qejc3hin5yLO4x8bxkZqrXTS-VNana8MhtWC0XA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1758 bytes --]

On Wed, Jul 02, 2014 at 03:16:40PM +0200, Stephane Eranian wrote:
> On Tue, Jul 1, 2014 at 11:34 AM, Peter Zijlstra <peterz@infradead.org> wrote:
> > On Mon, Jun 30, 2014 at 04:04:08PM -0700, David Rientjes wrote:
> >> It's unnecessary to excessively spam the kernel log anytime the BTS buffer
> >> cannot be allocated, so make this allocation __GFP_NOWARN.
> >>
> >> The user probably will want to at least find some artifact that the
> >> allocation has failed in the past, probably due to fragmentation because
> >> of its large size, when it's not allocated at bootstrap.  Thus, add a
> >> WARN_ONCE() so something is left behind for them to understand why perf
> >> commnads that require PEBS is not working properly.
> >
> > Can you elaborate a bit under which conditions this triggered? Typically
> > we should be doing fairly well allocating such buffers with GFP_KERNEL,
> > that should allow things like compaction to run and create higher order
> > pages.
> >
> I think this triggers when you have fragmented memory and you have
> perf_events active and inactive (i.e., 0 users = no nmi watchdog) frequently.
> Each first user invokes the reserve_ds() function to reserve DS, PEBS, BTS.

Right, that'd suck. I suppose we could also change that to allocate the
DS resources on first demand and never free them again.

So only allocate the PEBS buffer when we create the first PEBS event,
and idem for the BTS muck.

> The reason for BTS rather then PEBS is the size of the allocation.
> PEBS allocates one page, i.e., less likely to get a failure than BTS
> which allocates 4 pages, I think.

Sure..

> David and I discussed this. He can probably add more background
> info, if needed.

It would still be good to see why compaction etc is failing.

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2014-07-02 13:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-30 23:04 [patch] x86, perf: avoid spamming kernel log for bts buffer failure David Rientjes
2014-07-01  9:34 ` Peter Zijlstra
2014-07-02 13:16   ` Stephane Eranian
2014-07-02 13:31     ` Peter Zijlstra [this message]
2014-07-02 13:38       ` Stephane Eranian
2014-07-02 14:54         ` Peter Zijlstra
2014-07-02 23:30       ` David Rientjes
2014-07-14 23:33 ` David Rientjes
2014-07-15  8:53   ` Peter Zijlstra
2014-07-16 19:21 ` [tip:perf/urgent] perf/x86/intel: Avoid spamming kernel log for BTS " tip-bot for David Rientjes

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=20140702133105.GG19379@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.org \
    --cc=rientjes@google.com \
    --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