Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147327
b: refs/heads/master
c: b6276f3
h: refs/heads/master
i:
  147325: d7da25c
  147323: 230a3c3
  147319: f08e718
  147311: 3e01645
  147295: 3f219f9
  147263: d3b9d9f
  147199: dd9b477
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Apr 7, 2009
1 parent e0416fe commit db52352
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 671dec5daf3b3c43c5777be282f00120a44cf37f
refs/heads/master: b6276f353bf490add62dcf7db0ebd75baa3e1a37
1 change: 1 addition & 0 deletions trunk/arch/x86/include/asm/entry_arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ BUILD_INTERRUPT(spurious_interrupt,SPURIOUS_APIC_VECTOR)

#ifdef CONFIG_PERF_COUNTERS
BUILD_INTERRUPT(perf_counter_interrupt, LOCAL_PERF_VECTOR)
BUILD_INTERRUPT(perf_pending_interrupt, LOCAL_PENDING_VECTOR)
#endif

#ifdef CONFIG_X86_MCE_P4THERMAL
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/x86/include/asm/hardirq.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ typedef struct {
#endif
unsigned int generic_irqs; /* arch dependent */
unsigned int apic_perf_irqs;
unsigned int apic_pending_irqs;
#ifdef CONFIG_SMP
unsigned int irq_resched_count;
unsigned int irq_call_count;
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/x86/include/asm/hw_irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ extern void apic_timer_interrupt(void);
extern void generic_interrupt(void);
extern void error_interrupt(void);
extern void perf_counter_interrupt(void);
extern void perf_pending_interrupt(void);

extern void spurious_interrupt(void);
extern void thermal_interrupt(void);
Expand Down
5 changes: 5 additions & 0 deletions trunk/arch/x86/include/asm/irq_vectors.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@
*/
#define GENERIC_INTERRUPT_VECTOR 0xed

/*
* Performance monitoring pending work vector:
*/
#define LOCAL_PENDING_VECTOR 0xec

/*
* First APIC vector available to drivers: (vectors 0x30-0xee) we
* start at 0x31(0x41) to spread out vectors evenly between priority
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/x86/include/asm/perf_counter.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ union cpuid10_edx {
#define MSR_ARCH_PERFMON_FIXED_CTR2 0x30b
#define X86_PMC_IDX_FIXED_BUS_CYCLES (X86_PMC_IDX_FIXED + 2)

#define set_perf_counter_pending() do { } while (0)
extern void set_perf_counter_pending(void);

#define clear_perf_counter_pending() do { } while (0)
#define test_perf_counter_pending() (0)

Expand Down
14 changes: 14 additions & 0 deletions trunk/arch/x86/kernel/cpu/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,20 @@ void smp_perf_counter_interrupt(struct pt_regs *regs)
irq_exit();
}

void smp_perf_pending_interrupt(struct pt_regs *regs)
{
irq_enter();
ack_APIC_irq();
inc_irq_stat(apic_pending_irqs);
perf_counter_do_pending();
irq_exit();
}

void set_perf_counter_pending(void)
{
apic->send_IPI_self(LOCAL_PENDING_VECTOR);
}

void perf_counters_lapic_init(int nmi)
{
u32 apic_val;
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/x86/kernel/entry_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,8 @@ apicinterrupt SPURIOUS_APIC_VECTOR \
#ifdef CONFIG_PERF_COUNTERS
apicinterrupt LOCAL_PERF_VECTOR \
perf_counter_interrupt smp_perf_counter_interrupt
apicinterrupt LOCAL_PENDING_VECTOR \
perf_pending_interrupt smp_perf_pending_interrupt
#endif

/*
Expand Down
5 changes: 5 additions & 0 deletions trunk/arch/x86/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ static int show_other_interrupts(struct seq_file *p, int prec)
for_each_online_cpu(j)
seq_printf(p, "%10u ", irq_stats(j)->apic_perf_irqs);
seq_printf(p, " Performance counter interrupts\n");
seq_printf(p, "PND: ");
for_each_online_cpu(j)
seq_printf(p, "%10u ", irq_stats(j)->apic_pending_irqs);
seq_printf(p, " Performance pending work\n");
#endif
if (generic_interrupt_extension) {
seq_printf(p, "PLT: ");
Expand Down Expand Up @@ -171,6 +175,7 @@ u64 arch_irq_stat_cpu(unsigned int cpu)
sum += irq_stats(cpu)->apic_timer_irqs;
sum += irq_stats(cpu)->irq_spurious_count;
sum += irq_stats(cpu)->apic_perf_irqs;
sum += irq_stats(cpu)->apic_pending_irqs;
#endif
if (generic_interrupt_extension)
sum += irq_stats(cpu)->generic_irqs;
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/x86/kernel/irqinit_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ static void __init apic_intr_init(void)
alloc_intr_gate(ERROR_APIC_VECTOR, error_interrupt);
# ifdef CONFIG_PERF_COUNTERS
alloc_intr_gate(LOCAL_PERF_VECTOR, perf_counter_interrupt);
alloc_intr_gate(LOCAL_PENDING_VECTOR, perf_pending_interrupt);
# endif

# ifdef CONFIG_X86_MCE_P4THERMAL
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/x86/kernel/irqinit_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ static void __init apic_intr_init(void)
/* Performance monitoring interrupt: */
#ifdef CONFIG_PERF_COUNTERS
alloc_intr_gate(LOCAL_PERF_VECTOR, perf_counter_interrupt);
alloc_intr_gate(LOCAL_PENDING_VECTOR, perf_pending_interrupt);
#endif
}

Expand Down

0 comments on commit db52352

Please sign in to comment.