CFS-devel, latest code
Quoted 13 lines · Ingo Molnar
Quoted 9 lines · Dmitry Adamushko
here is a few patches on top of the recent 'sched-dev':
(1) [ proposal ] make timeslices of
SCHED_RRtasks constant and not dependent on task'sstatic_prio;(2) [ cleanup ]
calc_weighted()is obsolete, remove it;(3) [ refactoring ] make
dequeue_entity()/enqueue_entity()
andupdate_stats_dequeue()/update_stats_enqueue()look similar, structure-wise.
Quoted 6 lines
thanks - i've applied all 3 patches of yours.
Quoted 1 line
(compiles well, not functionally tested yet)
(it boots fine here and
SCHED_RRseems to work - but i've not tested getinterval.)
/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
---
kernel/sched.c +2 -1
@@ -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);
---
The following patch (sched: disable sleeper_fairness on SCHED_BATCH) seems to break GROUP_SCHED. Although, it may be 'oops'-less due to the possibility of 'p' being always a valid address.
---
kernel/sched_fair.c +2 -3
@@ -473,9 +473,8 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial) vruntime +=sched_vslice_add (cfs_rq, se);if (!initial) { - struct task_struct *p = container_of(se, struct task_struct, se); - -if (sched_feat (NEW_FAIR_SLEEPERS ) && p->policy !=SCHED_BATCH ) +if (sched_feat (NEW_FAIR_SLEEPERS ) &&entity_is_task (se) && +task_of (se)->policy !=SCHED_BATCH ) vruntime -= sysctl_sched_latency; vruntime =max_t (s64, vruntime, se->vruntime);
---
Srivatsa Vaddagiri
Acked-byQuoted 4 lines · Dmitry Adamushko
The following patch (sched: disable
sleeper_fairnessonSCHED_BATCH) seems to breakGROUP_SCHED. Although, it may be 'oops'-less due to the possibility of 'p' being always a valid address.
Thanks for catching it! Patch below looks good to me.
Quoted 22 lines
Signed-off-by Dmitry Adamushko <[email protected]>---
kernel/sched_fair.c +2
-4@@ -473,9 +473,8 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial) vruntime +=sched_vslice_add (cfs_rq, se);if (!initial) { - struct task_struct *p = container_of(se, struct task_struct, se); - -if (sched_feat (NEW_FAIR_SLEEPERS ) && p->policy !=SCHED_BATCH ) +if (sched_feat (NEW_FAIR_SLEEPERS ) &&entity_is_task (se) && +task_of (se)->policy !=SCHED_BATCH ) vruntime -= sysctl_sched_latency; vruntime =max_t (s64, vruntime, se->vruntime); ---
Signature · 2 lines
Regards, vatsa
Ingo Molnar
AppliedQuoted 3 lines · Dmitry Adamushko
The following patch (sched: disable
sleeper_fairnessonSCHED_BATCH) seems to breakGROUP_SCHED. Although, it may be 'oops'-less due to the possibility of 'p' being always a valid address.
thanks, applied.
Ingo
Ingo Molnar
AppliedQuoted 14 lines · Dmitry Adamushko
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)
Quoted 7 lines
dimm@earth:~/storage/prog$ ./rr_interval time_slice: 0 : 19996960(
SCHED_NORMAL+ acpu_hogof 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
thanks, applied.
Ingo