Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147480
b: refs/heads/master
c: afedadf
h: refs/heads/master
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed May 20, 2009
1 parent d73bd83 commit 3b1337a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 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: b986d7ec0f8b7ea3cc7366d80a137fbe839df227
refs/heads/master: afedadf23a2c90f3ba0d963282cbe6a6be129494
25 changes: 19 additions & 6 deletions trunk/kernel/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -826,8 +826,12 @@ void __perf_counter_sched_out(struct perf_counter_context *ctx,

perf_disable();
if (ctx->nr_active) {
list_for_each_entry(counter, &ctx->counter_list, list_entry)
group_sched_out(counter, cpuctx, ctx);
list_for_each_entry(counter, &ctx->counter_list, list_entry) {
if (counter != counter->group_leader)
counter_sched_out(counter, cpuctx, ctx);
else
group_sched_out(counter, cpuctx, ctx);
}
}
perf_enable();
out:
Expand Down Expand Up @@ -903,8 +907,12 @@ __perf_counter_sched_in(struct perf_counter_context *ctx,
if (counter->cpu != -1 && counter->cpu != cpu)
continue;

if (group_can_go_on(counter, cpuctx, 1))
group_sched_in(counter, cpuctx, ctx, cpu);
if (counter != counter->group_leader)
counter_sched_in(counter, cpuctx, ctx, cpu);
else {
if (group_can_go_on(counter, cpuctx, 1))
group_sched_in(counter, cpuctx, ctx, cpu);
}

/*
* If this pinned group hasn't been scheduled,
Expand Down Expand Up @@ -932,9 +940,14 @@ __perf_counter_sched_in(struct perf_counter_context *ctx,
if (counter->cpu != -1 && counter->cpu != cpu)
continue;

if (group_can_go_on(counter, cpuctx, can_add_hw)) {
if (group_sched_in(counter, cpuctx, ctx, cpu))
if (counter != counter->group_leader) {
if (counter_sched_in(counter, cpuctx, ctx, cpu))
can_add_hw = 0;
} else {
if (group_can_go_on(counter, cpuctx, can_add_hw)) {
if (group_sched_in(counter, cpuctx, ctx, cpu))
can_add_hw = 0;
}
}
}
perf_enable();
Expand Down

0 comments on commit 3b1337a

Please sign in to comment.