Re: [git] CFS-devel, group scheduler, fixes

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Tong Li <tong.n.li@...>
Cc: Ingo Molnar <mingo@...>, dimm <dmitry.adamushko@...>, <linux-kernel@...>, Srivatsa Vaddagiri <vatsa@...>, Peter Zijlstra <a.p.zijlstra@...>
Date: Monday, September 24, 2007 - 6:10 am

On Sun, 2007-09-23 at 23:21 -0700, Tong Li wrote: 

Hmm.  I can imagine Mondo-Boxen-R-Us folks getting upset with that.
Better would be like Ingo said, see if we can toss sync_vrintime(), and
I've been playing with that...

I found something this morning, and as usual, the darn thing turned out
to be dirt simple.  With sync_vruntime() disabled, I found queues with
negative min_vruntime right from boot, and went hunting.  Adding some
instrumentation to set_task_cpu() (annoying consequences), I found the
below:

Legend:
vrun: tasks's vruntime
old: old queue's min_vruntime
new: new queue's min_vruntime
result: what's gonna happen

[   60.214508] kseriod vrun: 1427596999 old: 15070988657 new: 4065818654 res: -9577573004
[  218.274661] konqueror vrun: 342076210254 old: 658982966338 new: 219203403598 res: -97703352486
[  218.284657] init vrun: 411638725179 old: 659187735208 new: 219203492472 res: -28345517557
[...]

A task which hasn't run in long enough for queues to have digressed
further than it's vruntime is going to end up with a negative vruntime.
Looking at place_entity(), it looks like it's supposed to fix that up,
but due to the order of arguments passed to max_vrintime(), and the
unsigned comparison therein, it won't.

Running with the patchlet below, my box _so far_ has not become
terminally unhappy despite spread0.  I'm writing this with the pinned
hogs test running right now, and all is well, so I _think_ it might be
ok to just remove sync_vruntime() after all.

diff -uprNX /root/dontdiff git/linux-2.6.sched-devel/kernel/sched_fair.c linux-2.6.23-rc7.d/kernel/sched_fair.c
--- git/linux-2.6.sched-devel/kernel/sched_fair.c	2007-09-23 14:48:18.000000000 +0200
+++ linux-2.6.23-rc7.d/kernel/sched_fair.c	2007-09-24 11:02:05.000000000 +0200
@@ -117,7 +117,7 @@ static inline struct task_struct *task_o
 static inline u64
 max_vruntime(u64 min_vruntime, u64 vruntime)
 {
-	if ((vruntime > min_vruntime) ||
+	if (((s64)vruntime > (s64)min_vruntime) ||
 	    (min_vruntime > (1ULL << 61) && vruntime < (1ULL << 50)))
 		min_vruntime = vruntime;
 
@@ -310,7 +310,7 @@ static void update_curr(struct cfs_rq *c
 	unsigned long delta_exec;
 
 	if (unlikely(!cfs_rq->nr_running))
-		return sync_vruntime(cfs_rq);
+		return ;//sync_vruntime(cfs_rq);
 	if (unlikely(!curr))
 		return;
 


-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [git] CFS-devel, group scheduler, fixes, dimm, (Tue Sep 18, 3:36 pm)
Re: [git] CFS-devel, group scheduler, fixes, Ingo Molnar, (Tue Sep 18, 4:16 pm)
Re: [git] CFS-devel, group scheduler, fixes, Tong Li, (Wed Sep 19, 2:03 am)
Re: [git] CFS-devel, group scheduler, fixes, Siddha, Suresh B, (Wed Sep 19, 3:35 pm)
Re: [git] CFS-devel, group scheduler, fixes, Tong Li, (Wed Sep 19, 4:58 pm)
Re: [git] CFS-devel, group scheduler, fixes, Mike Galbraith, (Wed Sep 19, 2:28 am)
Re: [git] CFS-devel, group scheduler, fixes, Mike Galbraith, (Wed Sep 19, 3:51 am)
Re: [git] CFS-devel, group scheduler, fixes, Mike Galbraith, (Wed Sep 19, 4:42 am)
Re: [git] CFS-devel, group scheduler, fixes, Tong Li, (Wed Sep 19, 1:06 pm)
Re: [git] CFS-devel, group scheduler, fixes, Mike Galbraith, (Thu Sep 20, 12:55 am)
Re: [git] CFS-devel, group scheduler, fixes, Mike Galbraith, (Thu Sep 20, 3:15 am)
Re: [git] CFS-devel, group scheduler, fixes, Willy Tarreau, (Thu Sep 20, 3:48 pm)
Re: [git] CFS-devel, group scheduler, fixes, Mike Galbraith, (Thu Sep 20, 10:40 pm)
Re: [git] CFS-devel, group scheduler, fixes, Willy Tarreau, (Thu Sep 20, 11:11 pm)
Re: [git] CFS-devel, group scheduler, fixes, Ingo Molnar, (Thu Sep 20, 3:51 am)
Re: [git] CFS-devel, group scheduler, fixes, Mike Galbraith, (Thu Sep 20, 4:11 am)
Re: [git] CFS-devel, group scheduler, fixes, Tong Li, (Fri Sep 21, 11:27 pm)
Re: [git] CFS-devel, group scheduler, fixes, Mike Galbraith, (Sat Sep 22, 6:01 am)
Re: [git] CFS-devel, group scheduler, fixes, Mike Galbraith, (Sun Sep 23, 3:14 am)
Re: [git] CFS-devel, group scheduler, fixes, Tong Li, (Mon Sep 24, 2:21 am)
Re: [git] CFS-devel, group scheduler, fixes, Mike Galbraith, (Mon Sep 24, 6:10 am)
Re: [git] CFS-devel, group scheduler, fixes, Peter Zijlstra, (Mon Sep 24, 6:24 am)
Re: [git] CFS-devel, group scheduler, fixes, Mike Galbraith, (Mon Sep 24, 6:42 am)
Re: [git] CFS-devel, group scheduler, fixes, Mike Galbraith, (Mon Sep 24, 7:22 am)
Re: [git] CFS-devel, group scheduler, fixes, Peter Zijlstra, (Mon Sep 24, 7:51 am)
Re: [git] CFS-devel, group scheduler, fixes, Tong Li, (Mon Sep 24, 12:43 pm)
Re: [git] CFS-devel, group scheduler, fixes, Peter Zijlstra, (Mon Sep 24, 7:08 am)
Re: [git] CFS-devel, group scheduler, fixes, Mike Galbraith, (Mon Sep 24, 7:43 am)
Re: [git] CFS-devel, group scheduler, fixes, Mike Galbraith, (Sun Sep 23, 7:37 am)
Re: [git] CFS-devel, group scheduler, fixes, Ingo Molnar, (Tue Sep 18, 4:22 pm)
Re: [git] CFS-devel, group scheduler, fixes, Srivatsa Vaddagiri, (Tue Sep 18, 11:55 pm)