aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched/core.c')
-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 8b489fcac37b..d1f7149f8704 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;