public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] perf_events: ctx_flexible_sched_in() not maximizing PMU  utilization
@ 2010-05-06 14:03 Stephane Eranian
  2010-05-06 14:20 ` Peter Zijlstra
  0 siblings, 1 reply; 16+ messages in thread
From: Stephane Eranian @ 2010-05-06 14:03 UTC (permalink / raw)
  To: LKML
  Cc: Peter Zijlstra, mingo, Paul Mackerras,
	Frédéric Weisbecker, David S. Miller, perfmon2-devel

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;
        }
}

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2010-05-14 15:07 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-06 14:03 [RFC] perf_events: ctx_flexible_sched_in() not maximizing PMU utilization Stephane Eranian
2010-05-06 14:20 ` Peter Zijlstra
2010-05-06 14:41   ` Stephane Eranian
2010-05-06 15:08     ` Peter Zijlstra
2010-05-06 16:26       ` Stephane Eranian
2010-05-06 17:11   ` Frederic Weisbecker
2010-05-06 17:30     ` Peter Zijlstra
2010-05-07  8:25       ` Peter Zijlstra
2010-05-07  8:44         ` Peter Zijlstra
2010-05-07  9:37         ` Stephane Eranian
2010-05-07 10:06           ` Peter Zijlstra
2010-05-07 10:49             ` Stephane Eranian
2010-05-07 11:15               ` Peter Zijlstra
2010-05-10  9:41                 ` Stephane Eranian
2010-05-14 14:55                   ` Peter Zijlstra
2010-05-14 15:07                     ` Peter Zijlstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox