lkml.org 
[lkml]   [2010]   [Sep]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC][PATCH 13/19] perf: Per cpu-context rotation timer
From
Date
On Tue, 2010-09-07 at 18:46 +0200, Peter Zijlstra wrote:
> +static enum hrtimer_restart perf_event_context_tick(struct hrtimer
> *timer)
> {
> + enum hrtimer_restart restart = HRTIMER_NORESTART;
> struct perf_cpu_context *cpuctx;
> struct perf_event_context *ctx;
> int rotate = 0;
>
> + cpuctx = container_of(timer, struct perf_cpu_context, timer);
>
> + if (cpuctx->ctx.nr_events) {
> + restart = HRTIMER_RESTART;
> + if (cpuctx->ctx.nr_events != cpuctx->ctx.nr_active)
> + rotate = 1;
> + }
>
> + ctx = current->perf_event_ctxp;
> + if (ctx && ctx->nr_events) {
> + restart = HRTIMER_RESTART;
> + if (ctx->nr_events != ctx->nr_active)
> + rotate = 1;
> + }

Note to self, this is probably racy against pmu_rotate_start().


\
 
 \ /
  Last update: 2010-09-07 19:11    [W:0.117 / U:28.424 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site