mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Stephane Eranian <eranian@google.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [patch] x86, perf: avoid spamming kernel log for bts buffer failure
Date: Mon, 30 Jun 2014 16:04:08 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.02.1406301600460.26302@chino.kir.corp.google.com> (raw)

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.

Signed-off-by: David Rientjes <rientjes@google.com>
---
 arch/x86/kernel/cpu/perf_event_intel_ds.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/cpu/perf_event_intel_ds.c b/arch/x86/kernel/cpu/perf_event_intel_ds.c
--- a/arch/x86/kernel/cpu/perf_event_intel_ds.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c
@@ -311,9 +311,11 @@ static int alloc_bts_buffer(int cpu)
 	if (!x86_pmu.bts)
 		return 0;
 
-	buffer = kzalloc_node(BTS_BUFFER_SIZE, GFP_KERNEL, node);
-	if (unlikely(!buffer))
+	buffer = kzalloc_node(BTS_BUFFER_SIZE, GFP_KERNEL | __GFP_NOWARN, node);
+	if (unlikely(!buffer)) {
+		WARN_ONCE(1, "%s: BTS buffer allocation failure\n", __func__);
 		return -ENOMEM;
+	}
 
 	max = BTS_BUFFER_SIZE / BTS_RECORD_SIZE;
 	thresh = max / 16;

             reply	other threads:[~2014-06-30 23:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-30 23:04 David Rientjes [this message]
2014-07-01  9:34 ` Peter Zijlstra
2014-07-02 13:16   ` Stephane Eranian
2014-07-02 13:31     ` Peter Zijlstra
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=alpine.DEB.2.02.1406301600460.26302@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.org \
    --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

all inboxes | Powered by JetHome®