Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 334327
b: refs/heads/master
c: 399aaa2
h: refs/heads/master
i:
  334325: 0e0f3ed
  334323: 9a29703
  334319: 18d4f74
v: v3
  • Loading branch information
Al Cooper authored and Ralf Baechle committed Oct 11, 2012
1 parent a48f150 commit 6c05006
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 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: ecb8ee8a8987368491bd0dab34353c724654ec55
refs/heads/master: 399aaa2568ad90e229d73da8e95ae460d322a4f3
4 changes: 4 additions & 0 deletions trunk/arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1928,6 +1928,7 @@ config MIPS_MT_SMP
select SYS_SUPPORTS_SCHED_SMT if SMP
select SYS_SUPPORTS_SMP
select SMP_UP
select MIPS_PERF_SHARED_TC_COUNTERS
help
This is a kernel model which is known a VSMP but lately has been
marketesed into SMVP.
Expand Down Expand Up @@ -2277,6 +2278,9 @@ config NR_CPUS
performance should round up your number of processors to the next
power of two.

config MIPS_PERF_SHARED_TC_COUNTERS
bool

#
# Timer Interrupt Frequency Configuration
#
Expand Down
16 changes: 8 additions & 8 deletions trunk/arch/mips/kernel/perf_event_mipsxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ static struct mips_pmu mipspmu;
#define M_PERFCTL_EVENT_MASK 0xfe0


#ifdef CONFIG_MIPS_MT_SMP
#ifdef CONFIG_MIPS_PERF_SHARED_TC_COUNTERS
static int cpu_has_mipsmt_pertccounters;

static DEFINE_RWLOCK(pmuint_rwlock);
Expand All @@ -156,10 +156,10 @@ static unsigned int counters_total_to_per_cpu(unsigned int counters)
return counters >> vpe_shift();
}

#else /* !CONFIG_MIPS_MT_SMP */
#else /* !CONFIG_MIPS_PERF_SHARED_TC_COUNTERS */
#define vpe_id() 0

#endif /* CONFIG_MIPS_MT_SMP */
#endif /* CONFIG_MIPS_PERF_SHARED_TC_COUNTERS */

static void resume_local_counters(void);
static void pause_local_counters(void);
Expand Down Expand Up @@ -503,7 +503,7 @@ static void mipspmu_read(struct perf_event *event)

static void mipspmu_enable(struct pmu *pmu)
{
#ifdef CONFIG_MIPS_MT_SMP
#ifdef CONFIG_MIPS_PERF_SHARED_TC_COUNTERS
write_unlock(&pmuint_rwlock);
#endif
resume_local_counters();
Expand All @@ -523,7 +523,7 @@ static void mipspmu_enable(struct pmu *pmu)
static void mipspmu_disable(struct pmu *pmu)
{
pause_local_counters();
#ifdef CONFIG_MIPS_MT_SMP
#ifdef CONFIG_MIPS_PERF_SHARED_TC_COUNTERS
write_lock(&pmuint_rwlock);
#endif
}
Expand Down Expand Up @@ -1163,7 +1163,7 @@ static int mipsxx_pmu_handle_shared_irq(void)
* See also mipsxx_pmu_start().
*/
pause_local_counters();
#ifdef CONFIG_MIPS_MT_SMP
#ifdef CONFIG_MIPS_PERF_SHARED_TC_COUNTERS
read_lock(&pmuint_rwlock);
#endif

Expand Down Expand Up @@ -1195,7 +1195,7 @@ static int mipsxx_pmu_handle_shared_irq(void)
if (handled == IRQ_HANDLED)
irq_work_run();

#ifdef CONFIG_MIPS_MT_SMP
#ifdef CONFIG_MIPS_PERF_SHARED_TC_COUNTERS
read_unlock(&pmuint_rwlock);
#endif
resume_local_counters();
Expand Down Expand Up @@ -1362,7 +1362,7 @@ init_hw_perf_events(void)
return -ENODEV;
}

#ifdef CONFIG_MIPS_MT_SMP
#ifdef CONFIG_MIPS_PERF_SHARED_TC_COUNTERS
cpu_has_mipsmt_pertccounters = read_c0_config7() & (1<<19);
if (!cpu_has_mipsmt_pertccounters)
counters = counters_total_to_per_cpu(counters);
Expand Down

0 comments on commit 6c05006

Please sign in to comment.