From: Huang Ying <ying.huang@intel.com>
To: Ingo Molnar <mingo@elte.hu>, "H. Peter Anvin" <hpa@zytor.com>
Cc: linux-kernel@vger.kernel.org, Andi Kleen <andi@firstfloor.org>,
Huang Ying <ying.huang@intel.com>
Subject: [RFC 3/3] Use unified NMI delayed call mechanism in perf event NMI handler
Date: Sat, 12 Jun 2010 17:28:16 +0800 [thread overview]
Message-ID: <1276334896-7075-3-git-send-email-ying.huang@intel.com> (raw)
In-Reply-To: <1276334896-7075-1-git-send-email-ying.huang@intel.com>
The original self interrupt mechanism in perf event NMI handler is
replaced by the unified delayed call mechanism.
Signed-off-by: Huang Ying <ying.huang@intel.com>
---
arch/x86/include/asm/entry_arch.h | 4 ----
arch/x86/include/asm/irq_vectors.h | 5 -----
arch/x86/kernel/cpu/perf_event.c | 13 ++++++++-----
arch/x86/kernel/entry_64.S | 5 -----
arch/x86/kernel/irqinit.c | 6 ------
5 files changed, 8 insertions(+), 25 deletions(-)
--- a/arch/x86/include/asm/entry_arch.h
+++ b/arch/x86/include/asm/entry_arch.h
@@ -49,10 +49,6 @@ BUILD_INTERRUPT(apic_timer_interrupt,LOC
BUILD_INTERRUPT(error_interrupt,ERROR_APIC_VECTOR)
BUILD_INTERRUPT(spurious_interrupt,SPURIOUS_APIC_VECTOR)
-#ifdef CONFIG_PERF_EVENTS
-BUILD_INTERRUPT(perf_pending_interrupt, LOCAL_PENDING_VECTOR)
-#endif
-
#ifdef CONFIG_X86_THERMAL_VECTOR
BUILD_INTERRUPT(thermal_interrupt,THERMAL_APIC_VECTOR)
#endif
--- a/arch/x86/include/asm/irq_vectors.h
+++ b/arch/x86/include/asm/irq_vectors.h
@@ -113,11 +113,6 @@
*/
#define X86_PLATFORM_IPI_VECTOR 0xed
-/*
- * Performance monitoring pending work vector:
- */
-#define LOCAL_PENDING_VECTOR 0xec
-
#define UV_BAU_MESSAGE 0xea
/*
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -1160,13 +1160,12 @@ static int x86_pmu_handle_irq(struct pt_
return handled;
}
-void smp_perf_pending_interrupt(struct pt_regs *regs)
+static int perf_delayed_call_id = NMI_DELAYED_CALL_ID_INVALID;
+
+void perf_do_pending(void)
{
- irq_enter();
- ack_APIC_irq();
inc_irq_stat(apic_pending_irqs);
perf_event_do_pending();
- irq_exit();
}
void set_perf_event_pending(void)
@@ -1175,7 +1174,7 @@ void set_perf_event_pending(void)
if (!x86_pmu.apic || !x86_pmu_initialized())
return;
- apic->send_IPI_self(LOCAL_PENDING_VECTOR);
+ nmi_delayed_call_schedule(perf_delayed_call_id);
#endif
}
@@ -1363,6 +1362,10 @@ void __init init_hw_perf_events(void)
}
}
+ perf_delayed_call_id = nmi_delayed_call_register(perf_do_pending);
+ if (perf_delayed_call_id == NMI_DELAYED_CALL_ID_INVALID)
+ pr_err("Failed to register NMI delayed call for perf.\n");
+
pr_info("... version: %d\n", x86_pmu.version);
pr_info("... bit width: %d\n", x86_pmu.cntval_bits);
pr_info("... generic registers: %d\n", x86_pmu.num_counters);
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -1021,11 +1021,6 @@ apicinterrupt ERROR_APIC_VECTOR \
apicinterrupt SPURIOUS_APIC_VECTOR \
spurious_interrupt smp_spurious_interrupt
-#ifdef CONFIG_PERF_EVENTS
-apicinterrupt LOCAL_PENDING_VECTOR \
- perf_pending_interrupt smp_perf_pending_interrupt
-#endif
-
/*
* Exception entry points.
*/
--- a/arch/x86/kernel/irqinit.c
+++ b/arch/x86/kernel/irqinit.c
@@ -223,12 +223,6 @@ static void __init apic_intr_init(void)
/* IPI vectors for APIC spurious and error interrupts */
alloc_intr_gate(SPURIOUS_APIC_VECTOR, spurious_interrupt);
alloc_intr_gate(ERROR_APIC_VECTOR, error_interrupt);
-
- /* Performance monitoring interrupts: */
-# ifdef CONFIG_PERF_EVENTS
- alloc_intr_gate(LOCAL_PENDING_VECTOR, perf_pending_interrupt);
-# endif
-
#endif
}
next prev parent reply other threads:[~2010-06-12 9:28 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-12 9:28 [RFC 1/3] Unified NMI delayed call mechanism Huang Ying
2010-06-12 9:28 ` [RFC 2/3] Use unified NMI delayed call mechanism in MCE handler Huang Ying
2010-06-12 9:28 ` Huang Ying [this message]
2010-06-12 10:25 ` [RFC 1/3] Unified NMI delayed call mechanism Ingo Molnar
2010-06-13 1:54 ` Huang Ying
2010-06-14 3:45 ` Hidetoshi Seto
2010-06-14 13:54 ` Don Zickus
2010-06-14 14:44 ` Andi Kleen
2010-06-14 15:12 ` Don Zickus
2010-06-18 10:30 ` Ingo Molnar
2010-06-18 9:48 ` Ingo Molnar
2010-06-18 11:34 ` huang ying
2010-06-18 12:45 ` Ingo Molnar
2010-06-18 13:40 ` huang ying
2010-06-18 14:35 ` Ingo Molnar
2010-06-18 15:16 ` huang ying
2010-06-18 15:31 ` Peter Zijlstra
2010-06-19 1:51 ` huang ying
2010-06-19 8:02 ` Andi Kleen
2010-06-19 10:53 ` Ingo Molnar
2010-06-19 14:07 ` huang ying
2010-06-19 14:24 ` Andi Kleen
2010-06-18 11:55 ` Peter Zijlstra
2010-06-18 12:25 ` Andi Kleen
2010-06-18 12:48 ` Peter Zijlstra
2010-06-18 13:09 ` Andi Kleen
2010-06-18 13:12 ` Peter Zijlstra
2010-06-18 13:23 ` Andi Kleen
2010-06-18 13:24 ` Peter Zijlstra
2010-06-18 14:37 ` Ingo Molnar
2010-06-19 14:17 ` Andi Kleen
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=1276334896-7075-3-git-send-email-ying.huang@intel.com \
--to=ying.huang@intel.com \
--cc=andi@firstfloor.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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