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

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-kernel@...>
Cc: Ingo Molnar <mingo@...>, Srivatsa Vaddagiri <vatsa@...>
Date: Tuesday, September 18, 2007 - 3:36 pm

[ well, don't expect to find here anything like RDCFS
(no, 'D' does not stand for 'dumb'!). I was focused
on more prosaic things in the mean time so just
didn't have time for writing it.. ]

here is a few cleanup/simplification/optimization(s)
based on the recent modifications in the sched-dev tree.

(1) optimize task_new_fair()
(2) simplify yield_task()
(3) rework enqueue/dequeue_entity() to get rid of
sched_class::set_curr_task()

additionally, the changes somewhat decrease code size:

   text    data     bss     dec     hex filename
  43538    5398      48   48984    bf58 build/kernel/sched.o.before
  43250    5390      48   48688    be30 build/kernel/sched.o

(SMP + lots of debugging options but, I guess, in this case the diff
should remain visible for any combination).

---

(1)

due to the fact that we no longer keep the 'current' within the tree,
dequeue/enqueue_entity() is useless for the 'current' in task_new_fair().
We are about to reschedule and sched_class->put_prev_task() will put
the 'current' back into the tree, based on its new key.

Signed-off-by: Dmitry Adamushko <dmitry.adamushko@gmail.com>

---
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 6e52d5a..5a244e2 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -969,10 +969,11 @@ static void task_new_fair(struct rq *rq, struct task_struct *p)
 
 	if (sysctl_sched_child_runs_first &&
 			curr->vruntime < se->vruntime) {
-
-		dequeue_entity(cfs_rq, curr, 0);
+		/*
+ 		 * Upon rescheduling, sched_class::put_prev_task() will place
+ 		 * 'current' within the tree based on its new key value.
+ 		 */
 		swap(curr->vruntime, se->vruntime);
-		enqueue_entity(cfs_rq, curr, 0);
 	}
 
 	update_stats_enqueue(cfs_rq, se);

---

Dmitry



-
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)