From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Dhaval Giani <dhaval@linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>,
Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>,
lkml <linux-kernel@vger.kernel.org>,
Mike Galbraith <efault@gmx.de>
Subject: Re: Regression in latest sched-git
Date: Thu, 14 Feb 2008 12:20:41 +0100 [thread overview]
Message-ID: <1202988041.6297.6.camel@lappy> (raw)
In-Reply-To: <20080212185355.GA6320@linux.vnet.ibm.com>
Hi Dhaval,
How does this patch (on top of todays sched-devel.git) work for you?
It keeps my laptop nice and spiffy when I run
let i=0; while [ $i -lt 100 ]; do let i+=1; while :; do :; done & done
under a third user (nobody). This generates huge latencies for the nobody
user (up to 1.6s) but root and peter don't seem to get above 40ms
---
include/linux/sched.h | 1 +
kernel/sched_fair.c | 6 +++++-
2 files changed, 6 insertions(+), 1 deletion(-)
Index: linux-2.6/include/linux/sched.h
===================================================================
--- linux-2.6.orig/include/linux/sched.h
+++ linux-2.6/include/linux/sched.h
@@ -925,6 +925,7 @@ struct sched_entity {
u64 exec_start;
u64 sum_exec_runtime;
u64 vruntime;
+ u64 vperiod;
u64 prev_sum_exec_runtime;
#ifdef CONFIG_SCHEDSTATS
Index: linux-2.6/kernel/sched_fair.c
===================================================================
--- linux-2.6.orig/kernel/sched_fair.c
+++ linux-2.6/kernel/sched_fair.c
@@ -220,9 +220,11 @@ static inline u64 min_vruntime(u64 min_v
static inline s64 entity_key(struct cfs_rq *cfs_rq, struct sched_entity *se)
{
- return se->vruntime - cfs_rq->min_vruntime;
+ return se->vruntime + se->vperiod - cfs_rq->min_vruntime;
}
+static u64 sched_vslice_add(struct cfs_rq *cfs_rq, struct sched_entity *se);
+
/*
* Enqueue an entity into the rb-tree:
*/
@@ -240,6 +242,8 @@ static void __enqueue_entity(struct cfs_
if (se == cfs_rq->curr)
return;
+ se->vperiod = sched_vslice_add(cfs_rq, se);
+
cfs_rq = &rq_of(cfs_rq)->cfs;
link = &cfs_rq->tasks_timeline.rb_node;
prev parent reply other threads:[~2008-02-14 11:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-12 18:53 Regression in latest sched-git Dhaval Giani
2008-02-12 19:40 ` Peter Zijlstra
2008-02-13 3:00 ` Srivatsa Vaddagiri
2008-02-13 12:51 ` Peter Zijlstra
2008-02-13 16:34 ` Dhaval Giani
2008-02-13 16:37 ` Dhaval Giani
2008-02-13 16:43 ` Peter Zijlstra
2008-02-13 17:06 ` Srivatsa Vaddagiri
2008-02-14 11:20 ` Peter Zijlstra [this message]
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=1202988041.6297.6.camel@lappy \
--to=a.p.zijlstra@chello.nl \
--cc=dhaval@linux.vnet.ibm.com \
--cc=efault@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=vatsa@linux.vnet.ibm.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