Re: [git] CFS-devel, latest code

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Dmitry Adamushko
Date: Tuesday, October 2, 2007 - 12:49 pm

On 01/10/2007, Ingo Molnar <mingo@elte.hu> wrote:

/me is guilty... it was a bit broken :-/ here is the fix.

results:

(SCHED_FIFO)

dimm@earth:~/storage/prog$ sudo chrt -f 10 ./rr_interval 
time_slice: 0 : 0

(SCHED_RR)

dimm@earth:~/storage/prog$ sudo chrt 10 ./rr_interval 
time_slice: 0 : 99984800

(SCHED_NORMAL)

dimm@earth:~/storage/prog$ ./rr_interval 
time_slice: 0 : 19996960

(SCHED_NORMAL + a cpu_hog of similar 'weight' on the same CPU --- so should be a half of the previous result)

dimm@earth:~/storage/prog$ taskset 1 ./rr_interval 
time_slice: 0 : 9998480


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

---
diff --git a/kernel/sched.c b/kernel/sched.c
index d835cd2..cce22ff 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4745,11 +4745,12 @@ long sys_sched_rr_get_interval(pid_t pid, struct timespec __user *interval)
 	else if (p->policy == SCHED_RR)
 		time_slice = DEF_TIMESLICE;
 	else {
+		struct sched_entity *se = &p->se;
 		unsigned long flags;
 		struct rq *rq;
 
 		rq = task_rq_lock(p, &flags);
-		time_slice = sched_slice(&rq->cfs, &p->se);
+		time_slice = NS_TO_JIFFIES(sched_slice(cfs_rq_of(se), se));
 		task_rq_unlock(rq, &flags);
 	}
 	read_unlock(&tasklist_lock);

---



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

Messages in current thread:
Re: [git] CFS-devel, latest code, Dmitry Adamushko, (Tue Oct 2, 12:49 pm)
Re: [git] CFS-devel, latest code, Dmitry Adamushko, (Tue Oct 2, 12:59 pm)
Re: [git] CFS-devel, latest code, Srivatsa Vaddagiri, (Tue Oct 2, 9:15 pm)
Re: [git] CFS-devel, latest code, Ingo Molnar, (Thu Oct 4, 12:40 am)
Re: [git] CFS-devel, latest code, Ingo Molnar, (Thu Oct 4, 12:41 am)