Skip to content

Commit

Permalink
perf_counter: round-robin per-CPU counters too
Browse files Browse the repository at this point in the history
This used to be unstable when we had the rq->lock dependencies,
but now that they are that of the past we can turn on percpu
counter RR too.

[ Impact: handle counter over-commit for per-CPU counters too ]

LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Ingo Molnar committed May 4, 2009
1 parent dab6f6a commit b82914c
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions kernel/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1069,18 +1069,14 @@ void perf_counter_task_tick(struct task_struct *curr, int cpu)
{
struct perf_cpu_context *cpuctx = &per_cpu(perf_cpu_context, cpu);
struct perf_counter_context *ctx = &curr->perf_counter_ctx;
const int rotate_percpu = 0;

if (rotate_percpu)
perf_counter_cpu_sched_out(cpuctx);
perf_counter_cpu_sched_out(cpuctx);
perf_counter_task_sched_out(curr, cpu);

if (rotate_percpu)
rotate_ctx(&cpuctx->ctx);
rotate_ctx(&cpuctx->ctx);
rotate_ctx(ctx);

if (rotate_percpu)
perf_counter_cpu_sched_in(cpuctx, cpu);
perf_counter_cpu_sched_in(cpuctx, cpu);
perf_counter_task_sched_in(curr, cpu);
}

Expand Down

0 comments on commit b82914c

Please sign in to comment.