mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Peter Zijlstra <a.p.zijlstra@chello.nl>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, eranian@google.com, hpa@zytor.com,
	mingo@redhat.com, a.p.zijlstra@chello.nl, tglx@linutronix.de,
	mingo@elte.hu
Subject: [tip:perf/urgent] perf, x86: Clean up reserve_ds_buffers() signature
Date: Fri, 22 Oct 2010 13:04:29 GMT	[thread overview]
Message-ID: <tip-f80c9e304b8e8062230b0cda2c2fdd586149c771@git.kernel.org> (raw)
In-Reply-To: <20101019134808.462621937@chello.nl>

Commit-ID:  f80c9e304b8e8062230b0cda2c2fdd586149c771
Gitweb:     http://git.kernel.org/tip/f80c9e304b8e8062230b0cda2c2fdd586149c771
Author:     Peter Zijlstra <a.p.zijlstra@chello.nl>
AuthorDate: Tue, 19 Oct 2010 14:50:02 +0200
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Fri, 22 Oct 2010 14:18:26 +0200

perf, x86: Clean up reserve_ds_buffers() signature

Now that reserve_ds_buffers() never fails, change it to return
void and remove all code dealing with the error return.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Stephane Eranian <eranian@google.com>
LKML-Reference: <20101019134808.462621937@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/x86/kernel/cpu/perf_event.c          |    9 +++------
 arch/x86/kernel/cpu/perf_event_intel_ds.c |    9 +++------
 2 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index 61e78f6..a333bf9 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -382,7 +382,7 @@ static void release_pmc_hardware(void) {}
 
 #endif
 
-static int reserve_ds_buffers(void);
+static void reserve_ds_buffers(void);
 static void release_ds_buffers(void);
 
 static void hw_perf_event_destroy(struct perf_event *event)
@@ -546,11 +546,8 @@ static int __x86_pmu_event_init(struct perf_event *event)
 		if (atomic_read(&active_events) == 0) {
 			if (!reserve_pmc_hardware())
 				err = -EBUSY;
-			else {
-				err = reserve_ds_buffers();
-				if (err)
-					release_pmc_hardware();
-			}
+			else
+				reserve_ds_buffers();
 		}
 		if (!err)
 			atomic_inc(&active_events);
diff --git a/arch/x86/kernel/cpu/perf_event_intel_ds.c b/arch/x86/kernel/cpu/perf_event_intel_ds.c
index 05c7db6..8a7f81c 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_ds.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c
@@ -191,7 +191,7 @@ static void release_ds_buffers(void)
 	put_online_cpus();
 }
 
-static int reserve_ds_buffers(void)
+static void reserve_ds_buffers(void)
 {
 	int bts_err = 0, pebs_err = 0;
 	int cpu;
@@ -200,7 +200,7 @@ static int reserve_ds_buffers(void)
 	x86_pmu.pebs_active = 0;
 
 	if (!x86_pmu.bts && !x86_pmu.pebs)
-		return 0;
+		return;
 
 	if (!x86_pmu.bts)
 		bts_err = 1;
@@ -251,8 +251,6 @@ static int reserve_ds_buffers(void)
 	}
 
 	put_online_cpus();
-
-	return 0;
 }
 
 /*
@@ -714,9 +712,8 @@ static void intel_ds_init(void)
 
 #else /* CONFIG_CPU_SUP_INTEL */
 
-static int reserve_ds_buffers(void)
+static void reserve_ds_buffers(void)
 {
-	return 0;
 }
 
 static void release_ds_buffers(void)

  reply	other threads:[~2010-10-22 13:05 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-19 13:42 [PATCH 0/7] perf,x86: PEBS/BTS buffer allocation changes Peter Zijlstra
2010-10-19 13:42 ` [PATCH 1/7] perf, x86: Extract PEBS/BTS buffer free routines Peter Zijlstra
2010-10-22 13:02   ` [tip:perf/urgent] " tip-bot for Peter Zijlstra
2010-10-19 13:42 ` [PATCH 2/7] perf, x86: Extract PEBS/BTS allocation functions Peter Zijlstra
2010-10-22 13:02   ` [tip:perf/urgent] " tip-bot for Peter Zijlstra
2010-10-19 13:42 ` [PATCH 3/7] perf, x86: Extract DS alloc/free functions Peter Zijlstra
2010-10-22 13:03   ` [tip:perf/urgent] " tip-bot for Peter Zijlstra
2010-10-19 13:43 ` [PATCH 4/7] perf, x86: Fixup the precise_ip computation Peter Zijlstra
2010-10-22 13:03   ` [tip:perf/urgent] " tip-bot for Peter Zijlstra
2010-10-22 13:04   ` [tip:perf/urgent] perf, x86: Less disastrous PEBS/BTS buffer allocation failure tip-bot for Peter Zijlstra
2010-10-19 13:43 ` [PATCH 5/7] " Peter Zijlstra
2010-10-19 13:43 ` [PATCH 6/7] perf, x86: Clean up reserve_ds_buffers() signature Peter Zijlstra
2010-10-22 13:04   ` tip-bot for Peter Zijlstra [this message]
2010-10-19 13:43 ` [PATCH 7/7] perf, x86: Use NUMA aware allocations for PEBS/BTS/DS allocations Peter Zijlstra
2010-10-22 13:04   ` [tip:perf/urgent] " tip-bot for Peter Zijlstra
2010-10-21 11:35 ` [PATCH 0/7] perf,x86: PEBS/BTS buffer allocation changes Peter Zijlstra
2010-10-21 11:45   ` Stephane Eranian
2010-10-21 14:30   ` Stephane Eranian
2010-10-21 14:34     ` Peter Zijlstra
2010-10-21 14:35       ` Stephane Eranian

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=tip-f80c9e304b8e8062230b0cda2c2fdd586149c771@git.kernel.org \
    --to=a.p.zijlstra@chello.nl \
    --cc=eranian@google.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.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

Powered by JetHome