From: Mike Galbraith <efault@gmx.de>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Paul Turner <pjt@google.com>,
Venkatesh Pallipadi <venki@google.com>,
Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC][PATCH] sched: Optimize cgroup pick_next_task_fair
Date: Sat, 11 Feb 2012 07:56:29 +0100 [thread overview]
Message-ID: <1328943389.7340.29.camel@marge.simpson.net> (raw)
In-Reply-To: <1328936700.2476.17.camel@laptop>
On Sat, 2012-02-11 at 06:05 +0100, Peter Zijlstra wrote:
> Since commit 2f36825b1 ("sched: Next buddy hint on sleep and preempt
> path") it is likely we pick a new task from the same cgroup, doing a put
> and then set on all intermediate entities is a waste of time, so try to
> avoid this.
Good idea, we need to lose some weight.
> XXX check put_prev_task()'s update_rq_clock() magic..
I made that even more lovable ;-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index d7c4322..7c1cfa6 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3175,6 +3175,7 @@ need_resched:
} else {
deactivate_task(rq, prev, DEQUEUE_SLEEP);
prev->on_rq = 0;
+ rq->skip_clock_update = 1;
/*
* If a worker went to sleep, notify and ask workqueue
@@ -3200,9 +3201,9 @@ need_resched:
put_prev_task(rq, prev);
next = pick_next_task(rq);
clear_tsk_need_resched(prev);
- rq->skip_clock_update = 0;
if (likely(prev != next)) {
+ rq->skip_clock_update = 0;
rq->nr_switches++;
rq->curr = next;
++*switch_count;
@@ -3220,6 +3221,7 @@ need_resched:
raw_spin_unlock_irq(&rq->lock);
post_schedule(rq);
+ rq->skip_clock_update = 0;
preempt_enable_no_resched();
if (need_resched())
> Compile tested only.. inspired by pjt's fast switch stories.
I was looking forward to seeing those fast switch patches, nice spot to
cut lard.
> Not-quite-signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
I'll see if I can give it some runtime.
-Mike
next prev parent reply other threads:[~2012-02-11 6:56 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-11 5:05 Peter Zijlstra
2012-02-11 6:56 ` Mike Galbraith [this message]
2012-02-11 15:02 ` Peter Zijlstra
2012-02-16 23:20 ` Peter Zijlstra
2012-02-16 23:28 ` Peter Zijlstra
2014-02-11 12:16 ` [tip:sched/core] sched/fair: Track cgroup depth tip-bot for Peter Zijlstra
2014-02-11 12:16 ` [tip:sched/core] sched: Push put_prev_task() into pick_next_task( ) tip-bot for Peter Zijlstra
2014-02-12 7:00 ` Kirill Tkhai
2014-02-12 11:43 ` Peter Zijlstra
2014-02-12 14:06 ` Peter Zijlstra
2014-02-12 14:24 ` Kirill Tkhai
2014-02-12 14:54 ` Peter Zijlstra
2014-02-11 12:16 ` [tip:sched/core] sched/fair: Clean up the __clear_buddies_*() functions tip-bot for Peter Zijlstra
2014-02-11 12:16 ` [tip:sched/core] sched/fair: Optimize cgroup pick_next_task_fair( ) tip-bot for 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=1328943389.7340.29.camel@marge.simpson.net \
--to=efault@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=pjt@google.com \
--cc=venki@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome