Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 211837
b: refs/heads/master
c: cde8e88
h: refs/heads/master
i:
  211835: b403d24
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Sep 13, 2010
1 parent 13c112a commit ebdb4f4
Show file tree
Hide file tree
Showing 2 changed files with 10 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: b0b2072df3b544f56b90173c2cde7a374c51546b
refs/heads/master: cde8e88498c8de69271fcb6d4dd974979368fa67
17 changes: 9 additions & 8 deletions trunk/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -3810,7 +3810,7 @@ static void perf_event_task_event(struct perf_task_event *task_event)
struct pmu *pmu;
int ctxn;

rcu_read_lock_sched();
rcu_read_lock();
list_for_each_entry_rcu(pmu, &pmus, entry) {
cpuctx = this_cpu_ptr(pmu->pmu_cpu_context);
perf_event_task_ctx(&cpuctx->ctx, task_event);
Expand All @@ -3825,7 +3825,7 @@ static void perf_event_task_event(struct perf_task_event *task_event)
if (ctx)
perf_event_task_ctx(ctx, task_event);
}
rcu_read_unlock_sched();
rcu_read_unlock();
}

static void perf_event_task(struct task_struct *task,
Expand Down Expand Up @@ -3943,7 +3943,7 @@ static void perf_event_comm_event(struct perf_comm_event *comm_event)

comm_event->event_id.header.size = sizeof(comm_event->event_id) + size;

rcu_read_lock_sched();
rcu_read_lock();
list_for_each_entry_rcu(pmu, &pmus, entry) {
cpuctx = this_cpu_ptr(pmu->pmu_cpu_context);
perf_event_comm_ctx(&cpuctx->ctx, comm_event);
Expand All @@ -3956,7 +3956,7 @@ static void perf_event_comm_event(struct perf_comm_event *comm_event)
if (ctx)
perf_event_comm_ctx(ctx, comm_event);
}
rcu_read_unlock_sched();
rcu_read_unlock();
}

void perf_event_comm(struct task_struct *task)
Expand Down Expand Up @@ -4126,7 +4126,7 @@ static void perf_event_mmap_event(struct perf_mmap_event *mmap_event)

mmap_event->event_id.header.size = sizeof(mmap_event->event_id) + size;

rcu_read_lock_sched();
rcu_read_lock();
list_for_each_entry_rcu(pmu, &pmus, entry) {
cpuctx = this_cpu_ptr(pmu->pmu_cpu_context);
perf_event_mmap_ctx(&cpuctx->ctx, mmap_event,
Expand All @@ -4142,7 +4142,7 @@ static void perf_event_mmap_event(struct perf_mmap_event *mmap_event)
vma->vm_flags & VM_EXEC);
}
}
rcu_read_unlock_sched();
rcu_read_unlock();

kfree(buf);
}
Expand Down Expand Up @@ -5218,10 +5218,11 @@ void perf_pmu_unregister(struct pmu *pmu)
mutex_unlock(&pmus_lock);

/*
* We use the pmu list either under SRCU or preempt_disable,
* synchronize_srcu() implies synchronize_sched() so we're good.
* We dereference the pmu list under both SRCU and regular RCU, so
* synchronize against both of those.
*/
synchronize_srcu(&pmus_srcu);
synchronize_rcu();

free_percpu(pmu->pmu_disable_count);
free_pmu_context(pmu->pmu_cpu_context);
Expand Down

0 comments on commit ebdb4f4

Please sign in to comment.