Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 211831
b: refs/heads/master
c: 1b9a644
h: refs/heads/master
i:
  211829: e2a5f21
  211827: fe3bc82
  211823: 8e6edec
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Sep 9, 2010
1 parent 5b2ff42 commit 6c82651
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 89a1e18731959e9953fae15ddc1a983eb15a4f19
refs/heads/master: 1b9a644fece117cfa5474a2388d6b89d1baf8ddf
6 changes: 6 additions & 0 deletions trunk/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,7 @@ static void ctx_sched_out(struct perf_event_context *ctx,
struct perf_event *event;

raw_spin_lock(&ctx->lock);
perf_pmu_disable(ctx->pmu);
ctx->is_active = 0;
if (likely(!ctx->nr_events))
goto out;
Expand All @@ -1083,6 +1084,7 @@ static void ctx_sched_out(struct perf_event_context *ctx,
group_sched_out(event, cpuctx, ctx);
}
out:
perf_pmu_enable(ctx->pmu);
raw_spin_unlock(&ctx->lock);
}

Expand Down Expand Up @@ -1400,6 +1402,7 @@ void perf_event_context_sched_in(struct perf_event_context *ctx)
if (cpuctx->task_ctx == ctx)
return;

perf_pmu_disable(ctx->pmu);
/*
* We want to keep the following priority order:
* cpu pinned (that don't need to move), task pinned,
Expand All @@ -1418,6 +1421,7 @@ void perf_event_context_sched_in(struct perf_event_context *ctx)
* cpu-context we got scheduled on is actually rotating.
*/
perf_pmu_rotate_start(ctx->pmu);
perf_pmu_enable(ctx->pmu);
}

/*
Expand Down Expand Up @@ -1629,6 +1633,7 @@ static enum hrtimer_restart perf_event_context_tick(struct hrtimer *timer)
rotate = 1;
}

perf_pmu_disable(cpuctx->ctx.pmu);
perf_ctx_adjust_freq(&cpuctx->ctx, cpuctx->timer_interval);
if (ctx)
perf_ctx_adjust_freq(ctx, cpuctx->timer_interval);
Expand All @@ -1649,6 +1654,7 @@ static enum hrtimer_restart perf_event_context_tick(struct hrtimer *timer)
task_ctx_sched_in(ctx, EVENT_FLEXIBLE);

done:
perf_pmu_enable(cpuctx->ctx.pmu);
hrtimer_forward_now(timer, ns_to_ktime(cpuctx->timer_interval));

return restart;
Expand Down

0 comments on commit 6c82651

Please sign in to comment.