sched_rt: don't start timer when rt bandwidth disabled
PATCH RESEND 1/1 sched_rt: don't start timer when rt bandwidth disabled
From: Hiroshi Shimamoto <[email protected]>
Impact: fix incorrect condition check
No need to start rt bandwidth timer when rt bandwidth is disabled. If this timer starts, it may stop at sched_rt_period_timer() on the first time.
Signed-off-by Hiroshi Shimamoto <[email protected]>
--- kernel/sched.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/sched.c +1 -1
@@ -223,7 +223,7 @@ static void start_rt_bandwidth(struct rt_bandwidth *rt_b) {ktime_t now; -if (rt_bandwidth_enabled () && rt_b->rt_runtime ==RUNTIME_INF ) +if (!rt_bandwidth_enabled () || rt_b->rt_runtime ==RUNTIME_INF )return ;if (hrtimer_active (&rt_b->rt_period_timer))
Signature · 1 line
1.6.1.2
Right, thanks for the reminder.
Quoted 8 lines · Hiroshi Shimamoto
From: Hiroshi Shimamoto <[email protected]>
Impact: fix incorrect condition check
No need to start rt bandwidth timer when rt bandwidth is disabled. If this timer starts, it may stop at
sched_rt_period_timer()on the first time.Signed-off-by Hiroshi Shimamoto <[email protected]>
Yep, looks like a good catch, thanks!
Quoted 17 lines
--- kernel/sched.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)kernel/sched.c +1
-1@@ -223,7 +223,7 @@ static void start_rt_bandwidth(struct rt_bandwidth *rt_b) {ktime_t now; -if (rt_bandwidth_enabled () && rt_b->rt_runtime ==RUNTIME_INF ) +if (!rt_bandwidth_enabled () || rt_b->rt_runtime ==RUNTIME_INF )return ;if (hrtimer_active (&rt_b->rt_period_timer))