Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147259
b: refs/heads/master
c: b6c5a71
h: refs/heads/master
i:
  147257: b76d6fa
  147255: 89f74ff
v: v3
  • Loading branch information
Paul Mackerras authored and Ingo Molnar committed Apr 6, 2009
1 parent 35d5d8e commit d38ff53
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 15 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: 7bb497bd885eedd0f56dfe3cc1b5ff20710d33b9
refs/heads/master: b6c5a71da1477d261bc36254fe1f20d32b57598d
14 changes: 11 additions & 3 deletions trunk/arch/powerpc/include/asm/hw_irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,17 @@ static inline unsigned long get_perf_counter_pending(void)
return x;
}

static inline void set_perf_counter_pending(int x)
static inline void set_perf_counter_pending(void)
{
asm volatile("stb %0,%1(13)" : :
"r" (x),
"r" (1),
"i" (offsetof(struct paca_struct, perf_counter_pending)));
}

static inline void clear_perf_counter_pending(void)
{
asm volatile("stb %0,%1(13)" : :
"r" (0),
"i" (offsetof(struct paca_struct, perf_counter_pending)));
}

Expand All @@ -158,7 +165,8 @@ static inline unsigned long get_perf_counter_pending(void)
return 0;
}

static inline void set_perf_counter_pending(int x) {}
static inline void set_perf_counter_pending(void) {}
static inline void clear_perf_counter_pending(void) {}
static inline void perf_counter_do_pending(void) {}
#endif /* CONFIG_PERF_COUNTERS */

Expand Down
11 changes: 3 additions & 8 deletions trunk/arch/powerpc/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,6 @@ static inline notrace void set_soft_enabled(unsigned long enable)
: : "r" (enable), "i" (offsetof(struct paca_struct, soft_enabled)));
}

#ifdef CONFIG_PERF_COUNTERS
notrace void __weak perf_counter_do_pending(void)
{
set_perf_counter_pending(0);
}
#endif

notrace void raw_local_irq_restore(unsigned long en)
{
/*
Expand Down Expand Up @@ -142,8 +135,10 @@ notrace void raw_local_irq_restore(unsigned long en)
iseries_handle_interrupts();
}

if (get_perf_counter_pending())
if (get_perf_counter_pending()) {
clear_perf_counter_pending();
perf_counter_do_pending();
}

/*
* if (get_paca()->hard_enabled) return;
Expand Down
3 changes: 1 addition & 2 deletions trunk/arch/powerpc/kernel/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,6 @@ void perf_counter_do_pending(void)
struct cpu_hw_counters *cpuhw = &__get_cpu_var(cpu_hw_counters);
struct perf_counter *counter;

set_perf_counter_pending(0);
for (i = 0; i < cpuhw->n_counters; ++i) {
counter = cpuhw->counter[i];
if (counter && counter->wakeup_pending) {
Expand Down Expand Up @@ -811,7 +810,7 @@ static void perf_counter_interrupt(struct pt_regs *regs)
perf_counter_do_pending();
irq_exit();
} else {
set_perf_counter_pending(1);
set_perf_counter_pending();
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/x86/include/asm/perf_counter.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ 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() \
set_tsk_thread_flag(current, TIF_PERF_COUNTERS);

#ifdef CONFIG_PERF_COUNTERS
extern void init_hw_perf_counters(void);
extern void perf_counters_lapic_init(int nmi);
Expand Down
2 changes: 1 addition & 1 deletion trunk/kernel/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1433,7 +1433,7 @@ static void perf_swcounter_interrupt(struct perf_counter *counter,

if (nmi) {
counter->wakeup_pending = 1;
set_tsk_thread_flag(current, TIF_PERF_COUNTERS);
set_perf_counter_pending();
} else
wake_up(&counter->waitq);
}
Expand Down

0 comments on commit d38ff53

Please sign in to comment.