aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2016-05-05 03:01:49 -0400
committerIngo Molnar <mingo@kernel.org>2016-05-05 03:01:49 -0400
commit64b7aad5798478ffff52e110878ccaae4c3aaa34 (patch)
tree211764492dba48c45cbf186c66efa320ab7540db /kernel/sched
parent078194f8e9fe3cf54c8fd8bded48a1db5bd8eb8a (diff)
parent2548d546d40c0014efdde88a53bf7896e917dcce (diff)
Merge branch 'sched/urgent' into sched/core, to pick up fixes before applying new changes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched')
-rw-r--r--kernel/sched/core.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index adcafda7ffc8..c82ca6eccfec 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -596,17 +596,8 @@ bool sched_can_stop_tick(struct rq *rq)
596 return false; 596 return false;
597 597
598 /* 598 /*
599 * FIFO realtime policy runs the highest priority task (after DEADLINE). 599 * If there are more than one RR tasks, we need the tick to effect the
600 * Other runnable tasks are of a lower priority. The scheduler tick 600 * actual RR behaviour.
601 * isn't needed.
602 */
603 fifo_nr_running = rq->rt.rt_nr_running - rq->rt.rr_nr_running;
604 if (fifo_nr_running)
605 return true;
606
607 /*
608 * Round-robin realtime tasks time slice with other tasks at the same
609 * realtime priority.
610 */ 601 */
611 if (rq->rt.rr_nr_running) { 602 if (rq->rt.rr_nr_running) {
612 if (rq->rt.rr_nr_running == 1) 603 if (rq->rt.rr_nr_running == 1)
@@ -615,8 +606,20 @@ bool sched_can_stop_tick(struct rq *rq)
615 return false; 606 return false;
616 } 607 }
617 608
618 /* Normal multitasking need periodic preemption checks */ 609 /*
619 if (rq->cfs.nr_running > 1) 610 * If there's no RR tasks, but FIFO tasks, we can skip the tick, no
611 * forced preemption between FIFO tasks.
612 */
613 fifo_nr_running = rq->rt.rt_nr_running - rq->rt.rr_nr_running;
614 if (fifo_nr_running)
615 return true;
616
617 /*
618 * If there are no DL,RR/FIFO tasks, there must only be CFS tasks left;
619 * if there's more than one we need the tick for involuntary
620 * preemption.
621 */
622 if (rq->nr_running > 1)
620 return false; 623 return false;
621 624
622 return true; 625 return true;