aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/sched_fair.c41
1 files changed, 19 insertions, 22 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 10d218ab69f2..29b35a7ec571 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -709,31 +709,28 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial)
709 if (initial && sched_feat(START_DEBIT)) 709 if (initial && sched_feat(START_DEBIT))
710 vruntime += sched_vslice(cfs_rq, se); 710 vruntime += sched_vslice(cfs_rq, se);
711 711
712 if (!initial) { 712 /* sleeps up to a single latency don't count. */
713 /* sleeps upto a single latency don't count. */ 713 if (!initial && sched_feat(FAIR_SLEEPERS)) {
714 if (sched_feat(FAIR_SLEEPERS)) { 714 unsigned long thresh = sysctl_sched_latency;
715 unsigned long thresh = sysctl_sched_latency;
716 715
717 /* 716 /*
718 * Convert the sleeper threshold into virtual time. 717 * Convert the sleeper threshold into virtual time.
719 * SCHED_IDLE is a special sub-class. We care about 718 * SCHED_IDLE is a special sub-class. We care about
720 * fairness only relative to other SCHED_IDLE tasks, 719 * fairness only relative to other SCHED_IDLE tasks,
721 * all of which have the same weight. 720 * all of which have the same weight.
722 */ 721 */
723 if (sched_feat(NORMALIZED_SLEEPER) && 722 if (sched_feat(NORMALIZED_SLEEPER) && (!entity_is_task(se) ||
724 (!entity_is_task(se) || 723 task_of(se)->policy != SCHED_IDLE))
725 task_of(se)->policy != SCHED_IDLE)) 724 thresh = calc_delta_fair(thresh, se);
726 thresh = calc_delta_fair(thresh, se);
727 725
728 /* 726 /*
729 * Halve their sleep time's effect, to allow 727 * Halve their sleep time's effect, to allow
730 * for a gentler effect of sleepers: 728 * for a gentler effect of sleepers:
731 */ 729 */
732 if (sched_feat(GENTLE_FAIR_SLEEPERS)) 730 if (sched_feat(GENTLE_FAIR_SLEEPERS))
733 thresh >>= 1; 731 thresh >>= 1;
734 732
735 vruntime -= thresh; 733 vruntime -= thresh;
736 }
737 } 734 }
738 735
739 /* ensure we never gain time by being placed backwards. */ 736 /* ensure we never gain time by being placed backwards. */