Messages in this thread Patch in this message | | | From | Frederic Weisbecker <> | Subject | [PATCH 6/6] perf: Increase round-robin fairness of flexible events | Date | Sun, 10 Jan 2010 02:38:20 +0100 |
| |
Group of flexible events are round-robined in each tick so that each group has its chance to be scheduled. But the fairness per group granularity doesn't propagate inside the groups themselves.
If only the first events of each groups have a chance to make their way, the remaining ones will never be scheduled.
Hence this patch propagates the round-robin to the events inside the groups.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Paul Mackerras <paulus@samba.org> --- kernel/perf_event.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/kernel/perf_event.c b/kernel/perf_event.c index 584e854..407137a 100644 --- a/kernel/perf_event.c +++ b/kernel/perf_event.c @@ -1446,16 +1446,21 @@ static void perf_ctx_adjust_freq(struct perf_event_context *ctx) */ static void rotate_ctx(struct perf_event_context *ctx) { + struct perf_event *leader; + if (!ctx->nr_events) return; raw_spin_lock(&ctx->lock); /* * Rotate the first entry last of non-pinned groups + * and events inside these groups */ perf_disable(); list_rotate_left(&ctx->flexible_groups); + list_for_each_entry(leader, &ctx->flexible_groups, group_entry) + list_rotate_left(&leader->sibling_list); perf_enable(); -- 1.6.2.3
| |