public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@openvz.org>
To: linux-kernel@vger.kernel.org
Cc: x86@kernel.org, fweisbec@gmail.com, acme@redhat.com,
	eranian@google.com, peterz@infradead.org,
	Cyrill Gorcunov <gorcunov@openvz.org>
Subject: [patch 2/2] x86, perf: Use apic_write unconditionally
Date: Wed, 17 Mar 2010 13:37:01 +0300	[thread overview]
Message-ID: <20100317104356.232371479@openvz.org> (raw)
In-Reply-To: 20100317103659.717877821@openvz.org

[-- Attachment #1: x86-perf-use-apic-dummy --]
[-- Type: text/plain, Size: 1823 bytes --]

Since apic_write maps to a plain noop in !CONFIG_X86_LOCAL_APIC
case we're safe to remove this conditional compilation
and clean code a bit.

CC: fweisbec@gmail.com
CC: acme@redhat.com
CC: eranian@google.com
CC: peterz@infradead.org
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
---
 arch/x86/kernel/cpu/perf_event.c    |    4 ----
 arch/x86/kernel/cpu/perf_event_p4.c |    2 --
 2 files changed, 6 deletions(-)

Index: linux-2.6.git/arch/x86/kernel/cpu/perf_event.c
=====================================================================
--- linux-2.6.git.orig/arch/x86/kernel/cpu/perf_event.c
+++ linux-2.6.git/arch/x86/kernel/cpu/perf_event.c
@@ -1135,7 +1135,6 @@ void set_perf_event_pending(void)
 
 void perf_events_lapic_init(void)
 {
-#ifdef CONFIG_X86_LOCAL_APIC
 	if (!x86_pmu.apic || !x86_pmu_initialized())
 		return;
 
@@ -1143,7 +1142,6 @@ void perf_events_lapic_init(void)
 	 * Always use NMI for PMU
 	 */
 	apic_write(APIC_LVTPC, APIC_DM_NMI);
-#endif
 }
 
 static int __kprobes
@@ -1167,9 +1165,7 @@ perf_event_nmi_handler(struct notifier_b
 
 	regs = args->regs;
 
-#ifdef CONFIG_X86_LOCAL_APIC
 	apic_write(APIC_LVTPC, APIC_DM_NMI);
-#endif
 	/*
 	 * Can't rely on the handled return value to say it was our NMI, two
 	 * events could trigger 'simultaneously' raising two back-to-back NMIs.
Index: linux-2.6.git/arch/x86/kernel/cpu/perf_event_p4.c
=====================================================================
--- linux-2.6.git.orig/arch/x86/kernel/cpu/perf_event_p4.c
+++ linux-2.6.git/arch/x86/kernel/cpu/perf_event_p4.c
@@ -363,10 +363,8 @@ static int p4_pmu_handle_irq(struct pt_r
 	}
 
 	if (handled) {
-#ifdef CONFIG_X86_LOCAL_APIC
 		/* p4 quirk: unmask it again */
 		apic_write(APIC_LVTPC, apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED);
-#endif
 		inc_irq_stat(apic_perf_irqs);
 	}
 


  parent reply	other threads:[~2010-03-17 10:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-17 10:36 [patch 0/2] x86, apic, perf - make apic_write/read noop on !APIC case Cyrill Gorcunov
2010-03-17 10:37 ` [patch 1/2] x86, apic: Allow to use sertain functions without APIC built-in support Cyrill Gorcunov
2010-03-18 17:37   ` [tip:perf/core] x86, apic: Allow to use certain " tip-bot for Cyrill Gorcunov
2010-03-17 10:37 ` Cyrill Gorcunov [this message]
2010-03-18 17:37   ` [tip:perf/core] x86, perf: Use apic_write unconditionally tip-bot for Cyrill Gorcunov

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=20100317104356.232371479@openvz.org \
    --to=gorcunov@openvz.org \
    --cc=acme@redhat.com \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.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