public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: Re: [PATCH 6/6] perf: Increase round-robin fairness of flexible events
Date: Mon, 11 Jan 2010 00:57:59 +0100	[thread overview]
Message-ID: <20100110235758.GC5039@nowhere> (raw)
In-Reply-To: <20100110220440.GA4595@brick.ozlabs.ibm.com>

On Mon, Jan 11, 2010 at 09:04:40AM +1100, Paul Mackerras wrote:
> Frederic,
> 
> Nice to see someone working on the event scheduling in perf.
> 
> But I don't think this patch makes sense:
> 
> > 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.
> 
> The semantic of a group is that either all of the events in the group
> are scheduled in, or none of them are.  So it doesn't make sense to
> talk about fairness within a group, and I don't see any point to
> rotating the elements of the sibling_list.  Or have I misunderstood
> what you're aiming at?


You're right. I forgot that a group that is only partially scheduled will
have its scheduled events cancelled.

But is it a sane behaviour considering the nature on non-pinned events?

Let's take an example. In x86 we have 4 breakpoint registers available.

We have 3 pinned breakpoint events in one group, and say, 2 groups
of flexible breakpoints:


 Pinned          Flexible0         Flexible1
   |                |                 |
  Bp1              Bp4               Bp6
  Bp2              Bp5               Bp7
  Bp3


The flexible ones will never get scheduled because
we only have 4 available slots and we need 5. And if
we try to schedule Flexible0, Bp4 will make it, but
not Bp5, so Bp4 get cancelled, and so on.

But the semantics of non-pinned counters is about
time-sharing them.

If we don't cancel partially-only scheduled flexible
groups and if we round robin inside flexible groups,
then these will all make it.

I think the constraint of "either every or none get
scheduled in a group" makes a lot of sense for pinned
groups.

But I don't see the point in applying this
rule inside flexible groups because the nature
of flexible events implies these have been created to
fight against a limited resource. So if this fight
is done only between groups, this is like raising
a voluntary starvation.

Or..or..May be I just realize too late that the semantic
of a group implies that all events inside must be always
counted simultaneously? In which case I agree with you,
this patch makes no sense and must be dropped.


  reply	other threads:[~2010-01-10 23:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-10  1:38 [PATCH 0/6] perf: Various event scheduling improvements Frederic Weisbecker
2010-01-10  1:38 ` [PATCH 1/6 v2] perf/core: Split context's event group list into pinned and non-pinned lists Frederic Weisbecker
2010-01-10  1:38 ` [PATCH 2/6] list: Introduce list_rotate_left() Frederic Weisbecker
2010-01-10  1:38 ` [PATCH 3/6] perf: Round robin groups of events using list_rotate_left() Frederic Weisbecker
2010-01-14 12:25   ` Peter Zijlstra
2010-01-14 12:29     ` Frederic Weisbecker
2010-01-14 12:32       ` Peter Zijlstra
2010-01-10  1:38 ` [PATCH 4/6] perf: Export software-only event group characteristic as a flag Frederic Weisbecker
2010-01-10  1:38 ` [PATCH 5/6] perf: Don't rotate pinned groups Frederic Weisbecker
2010-01-10  1:38 ` [PATCH 6/6] perf: Increase round-robin fairness of flexible events Frederic Weisbecker
2010-01-10 22:04   ` Paul Mackerras
2010-01-10 23:57     ` Frederic Weisbecker [this message]
2010-01-11  0:39       ` Paul Mackerras
2010-01-11  1:56         ` Frederic Weisbecker
2010-01-14 12:49 ` [PATCH 0/6] perf: Various event scheduling improvements Peter Zijlstra
2010-01-14 13:09   ` Frederic Weisbecker

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=20100110235758.GC5039@nowhere \
    --to=fweisbec@gmail.com \
    --cc=acme@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox