From: David S. Miller Date: Thu, 10 Sep 2009 12:59:24 +0000 (-0700) Subject: sparc64: Implement a real set_perf_counter_pending(). X-Git-Tag: v2.6.32-rc1~702^2~6 X-Git-Url: http://ftp.safe.ca/?a=commitdiff_plain;h=5686f9c3d67d5a20108fa26105c98b042df13123;hp=2d0740c4562493b60f59ca9b0330a2d5e01d43ec;p=safe%2Fjmp%2Flinux-2.6 sparc64: Implement a real set_perf_counter_pending(). When the perf counter subsystem needs to reschedule work out from an NMI, it invokes set_perf_counter_pending(). This triggers a non-NMI irq which should invoke perf_counter_do_pending(). Currently this won't trigger because sparc64 won't trigger the perf counter subsystem from NMIs, but when the HW counter support is added it will. Signed-off-by: David S. Miller --- diff --git a/arch/sparc/include/asm/perf_counter.h b/arch/sparc/include/asm/perf_counter.h index f07c587..38d6445 100644 --- a/arch/sparc/include/asm/perf_counter.h +++ b/arch/sparc/include/asm/perf_counter.h @@ -1,7 +1,7 @@ #ifndef __ASM_SPARC_PERF_COUNTER_H #define __ASM_SPARC_PERF_COUNTER_H -static inline void set_perf_counter_pending(void) { } +extern void set_perf_counter_pending(void); #define PERF_COUNTER_INDEX_OFFSET 0 diff --git a/arch/sparc/kernel/pcr.c b/arch/sparc/kernel/pcr.c index 1ae8cdd..68ff001 100644 --- a/arch/sparc/kernel/pcr.c +++ b/arch/sparc/kernel/pcr.c @@ -7,6 +7,8 @@ #include #include +#include + #include #include #include @@ -34,10 +36,20 @@ unsigned int picl_shift; */ void deferred_pcr_work_irq(int irq, struct pt_regs *regs) { + struct pt_regs *old_regs; + clear_softint(1 << PIL_DEFERRED_PCR_WORK); + + old_regs = set_irq_regs(regs); + irq_enter(); +#ifdef CONFIG_PERF_COUNTERS + perf_counter_do_pending(); +#endif + irq_exit(); + set_irq_regs(old_regs); } -void schedule_deferred_pcr_work(void) +void set_perf_counter_pending(void) { set_softint(1 << PIL_DEFERRED_PCR_WORK); }