All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Mark Rutland <mark.rutland@arm.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Will Deacon <Will.Deacon@arm.com>,
	Dave P Martin <Dave.Martin@arm.com>,
	Ingo Molnar <mingo@redhat.com>
Subject: Re: [PATCH 4/7] perf: be less pessimistic when scheduling events
Date: Tue, 25 Feb 2014 12:29:36 +0100	[thread overview]
Message-ID: <20140225112936.GM9987@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20140211174804.GC12476@e106331-lin.cambridge.arm.com>

On Tue, Feb 11, 2014 at 05:48:05PM +0000, Mark Rutland wrote:
> On Mon, Feb 10, 2014 at 05:58:54PM +0000, Peter Zijlstra wrote:
> > On Mon, Feb 10, 2014 at 05:44:21PM +0000, Mark Rutland wrote:
> > > This patch makes ctx_flexible_sched_in attempt to schedule every group
> > > in the flexible_groups list even when earlier groups failed to schedule,
> > > enabling more groups to be scheduled simultaneously.
> > 
> > Since you're basically free to create as many events as you want, you can
> > (as an unprivilidged user) make the context switch to and from your task
> > arbitrarily expensive.
> 
> Not that it makes the approach any better, but surely this is already
> the case for software events? 

Yeah, software events are a problem; I realized this the moment I send
that email. However, software events do not have the O(n!) programming
fail hw events have.

AMD Fam15h has a O(n^4) termination of the O(n*n!) algorithm, the rest
of x86 has a normal O(n^2) bound.

> I can create as many as I want, and they'll always try to schedule.
> 
> I'll take a look into other ways to stop disparate PMUs' events from
> adversely affecting each other. I guess it might not be possible to
> solve the general problem without allowing said expensive context
> switch.

So the problem you're facing is that you'll attach events for each PMU
available on the system to a particular task? And simply want to
continue scheduling even though a particular event will never fit on the
CPUs PMU its currently running on?

So the trivial work-around would be to create an event per cpu and set
event->cpu. That way you'll get the event_filter_match() exception in
ctx_flexible_sched_in() and we'll skip over all events that cannot be
programmed on this CPU.

The other approach is adding a cpumask to events, which would
drastically cut down on the amount of events you'd need to create; then
again, ARM doesn't have a silly amount of CPUs x86 has just quite yet.

  reply	other threads:[~2014-02-25 11:29 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-10 17:44 [PATCH 0/7] Perf core cleanups for shared perf_event_contexts Mark Rutland
2014-02-10 17:44 ` [PATCH 1/7] perf: fix prototype of find_pmu_context Mark Rutland
2014-02-27 13:33   ` [tip:perf/core] perf: Fix prototype of find_pmu_context() tip-bot for Mark Rutland
2014-02-10 17:44 ` [PATCH 2/7] perf: remove redundant pmu assignment Mark Rutland
2014-02-27 13:33   ` [tip:perf/core] perf: Remove redundant PMU assignment tip-bot for Mark Rutland
2014-02-10 17:44 ` [PATCH 3/7] perf: kill perf_event_context_type Mark Rutland
2014-02-25 11:38   ` Peter Zijlstra
2014-02-27 11:46     ` Mark Rutland
2014-02-10 17:44 ` [PATCH 4/7] perf: be less pessimistic when scheduling events Mark Rutland
2014-02-10 17:58   ` Peter Zijlstra
2014-02-11 17:48     ` Mark Rutland
2014-02-25 11:29       ` Peter Zijlstra [this message]
2014-02-27 12:07         ` Mark Rutland
2014-02-10 17:44 ` [PATCH 5/7] perf: kill pmu::hrtimer_interval_ms Mark Rutland
2014-02-10 17:44 ` [PATCH 6/7] perf: Centralise context pmu disabling Mark Rutland
2014-02-10 18:08   ` Peter Zijlstra
2014-02-10 17:44 ` [PATCH 7/7] perf: kill perf_event_context::pmu Mark Rutland
2014-02-10 18:10   ` Peter Zijlstra
2014-02-11 17:56     ` Mark Rutland
2014-02-12 15:01       ` Dave Martin
2014-02-25 11:31       ` Peter Zijlstra
2014-02-27 11:48         ` Mark Rutland
2014-02-27 11:51           ` Peter Zijlstra
2014-02-27 12:30             ` Mark Rutland
2014-02-19 13:43 ` [PATCH 0/7] Perf core cleanups for shared perf_event_contexts Mark Rutland
2014-02-25 11:39   ` Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140225112936.GM9987@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=Dave.Martin@arm.com \
    --cc=Will.Deacon@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.