Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull scheduler fix from Ingo Molnar:
"This contains a single fix that fixes a nohz tick stopping bug when
mixed-poliocy SCHED_FIFO and SCHED_RR tasks are present on a runqueue"

* 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
nohz/full, sched/rt: Fix missed tick-reenabling bug in sched_can_stop_tick()

+16 -13
+16 -13
kernel/sched/core.c
··· 596 596 return false; 597 597 598 598 /* 599 - * FIFO realtime policy runs the highest priority task (after DEADLINE). 600 - * Other runnable tasks are of a lower priority. The scheduler tick 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. 599 + * If there are more than one RR tasks, we need the tick to effect the 600 + * actual RR behaviour. 610 601 */ 611 602 if (rq->rt.rr_nr_running) { 612 603 if (rq->rt.rr_nr_running == 1) ··· 606 615 return false; 607 616 } 608 617 609 - /* Normal multitasking need periodic preemption checks */ 610 - if (rq->cfs.nr_running > 1) 618 + /* 619 + * If there's no RR tasks, but FIFO tasks, we can skip the tick, no 620 + * forced preemption between FIFO tasks. 621 + */ 622 + fifo_nr_running = rq->rt.rt_nr_running - rq->rt.rr_nr_running; 623 + if (fifo_nr_running) 624 + return true; 625 + 626 + /* 627 + * If there are no DL,RR/FIFO tasks, there must only be CFS tasks left; 628 + * if there's more than one we need the tick for involuntary 629 + * preemption. 630 + */ 631 + if (rq->nr_running > 1) 611 632 return false; 612 633 613 634 return true;