rt.c (96d3c5a7d20ec546e44695983fe0508c6f904248) | rt.c (b2f7d7507982ed56d301ba0f75f040fd1e930214) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Real-Time Scheduling Class (mapped to the SCHED_FIFO and SCHED_RR 4 * policies) 5 */ 6 7int sched_rr_timeslice = RR_TIMESLICE; 8/* More than 4 hours if BW_SHIFT equals 20. */ --- 943 unchanged lines hidden (view full) --- 952 runtime = rt_rq->rt_runtime; 953 rt_rq->rt_time -= min(rt_rq->rt_time, overrun*runtime); 954 if (rt_rq->rt_throttled && rt_rq->rt_time < runtime) { 955 rt_rq->rt_throttled = 0; 956 enqueue = 1; 957 958 /* 959 * When we're idle and a woken (rt) task is | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Real-Time Scheduling Class (mapped to the SCHED_FIFO and SCHED_RR 4 * policies) 5 */ 6 7int sched_rr_timeslice = RR_TIMESLICE; 8/* More than 4 hours if BW_SHIFT equals 20. */ --- 943 unchanged lines hidden (view full) --- 952 runtime = rt_rq->rt_runtime; 953 rt_rq->rt_time -= min(rt_rq->rt_time, overrun*runtime); 954 if (rt_rq->rt_throttled && rt_rq->rt_time < runtime) { 955 rt_rq->rt_throttled = 0; 956 enqueue = 1; 957 958 /* 959 * When we're idle and a woken (rt) task is |
960 * throttled check_preempt_curr() will set | 960 * throttled wakeup_preempt() will set |
961 * skip_update and the time between the wakeup 962 * and this unthrottle will get accounted as 963 * 'runtime'. 964 */ 965 if (rt_rq->rt_nr_running && rq->curr == rq->idle) 966 rq_clock_cancel_skipupdate(rq); 967 } 968 if (rt_rq->rt_time || rt_rq->rt_nr_running) --- 745 unchanged lines hidden (view full) --- 1714 1715 return sched_stop_runnable(rq) || sched_dl_runnable(rq) || sched_rt_runnable(rq); 1716} 1717#endif /* CONFIG_SMP */ 1718 1719/* 1720 * Preempt the current task with a newly woken task if needed: 1721 */ | 961 * skip_update and the time between the wakeup 962 * and this unthrottle will get accounted as 963 * 'runtime'. 964 */ 965 if (rt_rq->rt_nr_running && rq->curr == rq->idle) 966 rq_clock_cancel_skipupdate(rq); 967 } 968 if (rt_rq->rt_time || rt_rq->rt_nr_running) --- 745 unchanged lines hidden (view full) --- 1714 1715 return sched_stop_runnable(rq) || sched_dl_runnable(rq) || sched_rt_runnable(rq); 1716} 1717#endif /* CONFIG_SMP */ 1718 1719/* 1720 * Preempt the current task with a newly woken task if needed: 1721 */ |
1722static void check_preempt_curr_rt(struct rq *rq, struct task_struct *p, int flags) | 1722static void wakeup_preempt_rt(struct rq *rq, struct task_struct *p, int flags) |
1723{ 1724 if (p->prio < rq->curr->prio) { 1725 resched_curr(rq); 1726 return; 1727 } 1728 1729#ifdef CONFIG_SMP 1730 /* --- 974 unchanged lines hidden (view full) --- 2705#endif 2706 2707DEFINE_SCHED_CLASS(rt) = { 2708 2709 .enqueue_task = enqueue_task_rt, 2710 .dequeue_task = dequeue_task_rt, 2711 .yield_task = yield_task_rt, 2712 | 1723{ 1724 if (p->prio < rq->curr->prio) { 1725 resched_curr(rq); 1726 return; 1727 } 1728 1729#ifdef CONFIG_SMP 1730 /* --- 974 unchanged lines hidden (view full) --- 2705#endif 2706 2707DEFINE_SCHED_CLASS(rt) = { 2708 2709 .enqueue_task = enqueue_task_rt, 2710 .dequeue_task = dequeue_task_rt, 2711 .yield_task = yield_task_rt, 2712 |
2713 .check_preempt_curr = check_preempt_curr_rt, | 2713 .wakeup_preempt = wakeup_preempt_rt, |
2714 2715 .pick_next_task = pick_next_task_rt, 2716 .put_prev_task = put_prev_task_rt, 2717 .set_next_task = set_next_task_rt, 2718 2719#ifdef CONFIG_SMP 2720 .balance = balance_rt, 2721 .pick_task = pick_task_rt, --- 370 unchanged lines hidden --- | 2714 2715 .pick_next_task = pick_next_task_rt, 2716 .put_prev_task = put_prev_task_rt, 2717 .set_next_task = set_next_task_rt, 2718 2719#ifdef CONFIG_SMP 2720 .balance = balance_rt, 2721 .pick_task = pick_task_rt, --- 370 unchanged lines hidden --- |