Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 223901
b: refs/heads/master
c: c079c79
h: refs/heads/master
i:
  223899: f026764
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Dec 8, 2010
1 parent 901c211 commit f7eff47
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 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: b38aa89600be39b3e10c5b6529aed2e66518598e
refs/heads/master: c079c791c5a0627fc7b752d31d72e274e0596ba8
16 changes: 3 additions & 13 deletions trunk/arch/x86/kernel/cpu/perf_event_amd.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#ifdef CONFIG_CPU_SUP_AMD

static DEFINE_RAW_SPINLOCK(amd_nb_lock);

static __initconst const u64 amd_hw_cache_event_ids
[PERF_COUNT_HW_CACHE_MAX]
[PERF_COUNT_HW_CACHE_OP_MAX]
Expand Down Expand Up @@ -275,7 +273,7 @@ amd_get_event_constraints(struct cpu_hw_events *cpuc, struct perf_event *event)
return &emptyconstraint;
}

static struct amd_nb *amd_alloc_nb(int cpu, int nb_id)
static struct amd_nb *amd_alloc_nb(int cpu)
{
struct amd_nb *nb;
int i;
Expand All @@ -285,7 +283,7 @@ static struct amd_nb *amd_alloc_nb(int cpu, int nb_id)
if (!nb)
return NULL;

nb->nb_id = nb_id;
nb->nb_id = -1;

/*
* initialize all possible NB constraints
Expand All @@ -306,7 +304,7 @@ static int amd_pmu_cpu_prepare(int cpu)
if (boot_cpu_data.x86_max_cores < 2)
return NOTIFY_OK;

cpuc->amd_nb = amd_alloc_nb(cpu, -1);
cpuc->amd_nb = amd_alloc_nb(cpu);
if (!cpuc->amd_nb)
return NOTIFY_BAD;

Expand All @@ -325,8 +323,6 @@ static void amd_pmu_cpu_starting(int cpu)
nb_id = amd_get_nb_id(cpu);
WARN_ON_ONCE(nb_id == BAD_APICID);

raw_spin_lock(&amd_nb_lock);

for_each_online_cpu(i) {
nb = per_cpu(cpu_hw_events, i).amd_nb;
if (WARN_ON_ONCE(!nb))
Expand All @@ -341,8 +337,6 @@ static void amd_pmu_cpu_starting(int cpu)

cpuc->amd_nb->nb_id = nb_id;
cpuc->amd_nb->refcnt++;

raw_spin_unlock(&amd_nb_lock);
}

static void amd_pmu_cpu_dead(int cpu)
Expand All @@ -354,8 +348,6 @@ static void amd_pmu_cpu_dead(int cpu)

cpuhw = &per_cpu(cpu_hw_events, cpu);

raw_spin_lock(&amd_nb_lock);

if (cpuhw->amd_nb) {
struct amd_nb *nb = cpuhw->amd_nb;

Expand All @@ -364,8 +356,6 @@ static void amd_pmu_cpu_dead(int cpu)

cpuhw->amd_nb = NULL;
}

raw_spin_unlock(&amd_nb_lock);
}

static __initconst const struct x86_pmu amd_pmu = {
Expand Down

0 comments on commit f7eff47

Please sign in to comment.