[RFC] perf_events: ctx_flexible_sched_in() not maximizing PMU utilization

From: Stephane Eranian
Date: Thu May 06 2010 - 10:03:43 EST


Hi,

Looking at ctx_flexible_sched_in(), the logic is that if group_sched_in()
fails for a HW group, then no other HW group in the list is even tried.
I don't understand this restriction. Groups are independent of each other.
The failure of one group should not block others from being scheduled,
otherwise you under-utilize the PMU.

What is the reason for this restriction? Can we lift it somehow?

static void
ctx_flexible_sched_in(struct perf_event_context *ctx,
struct perf_cpu_context *cpuctx)
{
struct perf_event *event;
int can_add_hw = 1;

list_for_each_entry(event, &ctx->flexible_groups, group_entry) {
/* Ignore events in OFF or ERROR state */
if (event->state <= PERF_EVENT_STATE_OFF)
continue;
/*
* Listen to the 'cpu' scheduling filter constraint
* of events:
*/
if (event->cpu != -1 && event->cpu != smp_processor_id())
continue;

if (group_can_go_on(event, cpuctx, can_add_hw))
if (group_sched_in(event, cpuctx, ctx))
can_add_hw = 0;
}
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/