login
Header Space

 
 

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

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Mike Galbraith <efault@...>
Cc: Ingo Molnar <mingo@...>, dimm <dmitry.adamushko@...>, <linux-kernel@...>, Srivatsa Vaddagiri <vatsa@...>, Peter Zijlstra <a.p.zijlstra@...>
Date: Monday, September 24, 2007 - 2:21 am

On Sun, 23 Sep 2007, Mike Galbraith wrote:


I think this could be what was happening: between the two seconds, CPU 0 
becomes idle and it pulls the nice 19 task over via pull_task(), which 
calls set_task_cpu(), which changes the task's vruntime to the current 
min_vruntime of CPU 0 (in my patch). Then, after set_task_cpu(), CPU 0 
calls activate_task(), which calls enqueue_task() and in turn 
update_curr(). Now, nr_running on CPU 0 is 0, so sync_vruntime() gets 
called and CPU 0's min_vruntime gets synced to the system max. Thus, the 
nice 19 task now has a vruntime less than CPU 0's min_vruntime. I think 
this can be fixed by adding the following code in set_task_cpu() before we 
adjust p->vruntime:

if (!new_rq->cfs.nr_running)
 	sync_vruntime(new_rq);


I think this rq->lock check works because it prevents the above scenario 
(CPU 0 is in pull_task so it must hold the rq lock). But my concern is 
that it may be too conservative, since sync_vruntime is called by 
update_curr, which mostly gets called in enqueue_task() and 
dequeue_task(), both of which are often invoked with the rq lock being 
held. Thus, if we don't allow sync_vruntime when rq lock is held, the sync 
will occur much less frequently and thus weaken cross-CPU fairness.

   tong
-
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)
speck-geostationary