lkml.org 
[lkml]   [2009]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: scheduler oddity [bug?]
From
Date
On Sun, 2009-03-08 at 10:58 +0100, Mike Galbraith wrote:
>
> The below cures it, but is only a demo hack.
>
> diff --git a/kernel/sched.c b/kernel/sched.c
> index 8e2558c..85f9ced 100644
> --- a/kernel/sched.c
> +++ b/kernel/sched.c
> @@ -1712,11 +1712,15 @@ static void enqueue_task(struct rq *rq, struct task_struct *p, int wakeup)
>
> static void dequeue_task(struct rq *rq, struct task_struct *p, int sleep)
> {
> + u64 limit = sysctl_sched_migration_cost;
> + u64 runtime = p->se.sum_exec_runtime - p->se.prev_sum_exec_runtime;
> +
> if (sleep && p->se.last_wakeup) {
> update_avg(&p->se.avg_overlap,
> p->se.sum_exec_runtime - p->se.last_wakeup);
> p->se.last_wakeup = 0;
> - }


Wouldn't something like the below be more suited:

diff --git a/kernel/sched.c b/kernel/sched.c
index 89e2ca0..94c8b02 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2501,7 +2501,7 @@ static void __sched_fork(struct task_struct *p)
p->se.prev_sum_exec_runtime = 0;
p->se.nr_migrations = 0;
p->se.last_wakeup = 0;
- p->se.avg_overlap = 0;
+ p->se.avg_overlap = sysctl_sched_migration_cost;
p->se.start_runtime = 0;
p->se.avg_wakeup = sysctl_sched_wakeup_granularity;




\
 
 \ /
  Last update: 2009-03-08 11:23    [W:0.065 / U:37.612 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site