]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
x86, perf: Use apic_write unconditionally
authorCyrill Gorcunov <gorcunov@openvz.org>
Wed, 17 Mar 2010 10:37:01 +0000 (13:37 +0300)
committerIngo Molnar <mingo@elte.hu>
Thu, 18 Mar 2010 16:03:22 +0000 (17:03 +0100)
Since apic_write() maps to a plain noop in the !CONFIG_X86_LOCAL_APIC
case we're safe to remove this conditional compilation and clean up
the code a bit.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: fweisbec@gmail.com
Cc: acme@redhat.com
Cc: eranian@google.com
Cc: peterz@infradead.org
LKML-Reference: <20100317104356.232371479@openvz.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/cpu/perf_event.c
arch/x86/kernel/cpu/perf_event_p4.c

index c97d5b52d12a47f75e88568004965428017db03b..14eca80918dc526e63eee73be95af46679e49a9e 100644 (file)
@@ -1136,7 +1136,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;
 
@@ -1144,7 +1143,6 @@ void perf_events_lapic_init(void)
         * Always use NMI for PMU
         */
        apic_write(APIC_LVTPC, APIC_DM_NMI);
-#endif
 }
 
 static int __kprobes
@@ -1168,9 +1166,7 @@ perf_event_nmi_handler(struct notifier_block *self,
 
        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 a11ce73a93c988ead3483ab51bb71d9d26642d37..0367889b4ae0a05ab7f8064e12053697b75410e7 100644 (file)
@@ -363,10 +363,8 @@ static int p4_pmu_handle_irq(struct pt_regs *regs)
        }
 
        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);
        }