mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Paul Mackerras <paulus@samba.org>
Subject: [PATCH 6/6] perf: Increase round-robin fairness of flexible events
Date: Sun, 10 Jan 2010 02:38:20 +0100	[thread overview]
Message-ID: <1263087500-14215-7-git-send-regression-fweisbec@gmail.com> (raw)
In-Reply-To: <1263087500-14215-1-git-send-regression-fweisbec@gmail.com>

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


  parent reply	other threads:[~2010-01-10  1:38 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 ` Frederic Weisbecker [this message]
2010-01-10 22:04   ` [PATCH 6/6] perf: Increase round-robin fairness of flexible events Paul Mackerras
2010-01-10 23:57     ` Frederic Weisbecker
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=1263087500-14215-7-git-send-regression-fweisbec@gmail.com \
    --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

all inboxes | Powered by JetHome®