Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182388
b: refs/heads/master
c: 329c0e0
h: refs/heads/master
v: v3
  • Loading branch information
Frederic Weisbecker committed Jan 17, 2010
1 parent 3d0acc7 commit 4197fda
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 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: 7defb0f879bbcfe29e3c6f29d685d4f29b7a0700
refs/heads/master: 329c0e012b99fa2325a0be205c052e4aba690f16
34 changes: 27 additions & 7 deletions trunk/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1362,6 +1362,14 @@ ctx_sched_in(struct perf_event_context *ctx,
raw_spin_unlock(&ctx->lock);
}

static void cpu_ctx_sched_in(struct perf_cpu_context *cpuctx,
enum event_type_t event_type)
{
struct perf_event_context *ctx = &cpuctx->ctx;

ctx_sched_in(ctx, cpuctx, event_type);
}

static void task_ctx_sched_in(struct task_struct *task,
enum event_type_t event_type)
{
Expand All @@ -1388,15 +1396,27 @@ static void task_ctx_sched_in(struct task_struct *task,
*/
void perf_event_task_sched_in(struct task_struct *task)
{
task_ctx_sched_in(task, EVENT_ALL);
}
struct perf_cpu_context *cpuctx = &__get_cpu_var(perf_cpu_context);
struct perf_event_context *ctx = task->perf_event_ctxp;

static void cpu_ctx_sched_in(struct perf_cpu_context *cpuctx,
enum event_type_t event_type)
{
struct perf_event_context *ctx = &cpuctx->ctx;
if (likely(!ctx))
return;

ctx_sched_in(ctx, cpuctx, event_type);
if (cpuctx->task_ctx == ctx)
return;

/*
* We want to keep the following priority order:
* cpu pinned (that don't need to move), task pinned,
* cpu flexible, task flexible.
*/
cpu_ctx_sched_out(cpuctx, EVENT_FLEXIBLE);

ctx_sched_in(ctx, cpuctx, EVENT_PINNED);
cpu_ctx_sched_in(cpuctx, EVENT_FLEXIBLE);
ctx_sched_in(ctx, cpuctx, EVENT_FLEXIBLE);

cpuctx->task_ctx = ctx;
}

#define MAX_INTERRUPTS (~0ULL)
Expand Down

0 comments on commit 4197fda

Please sign in to comment.