Skip to contentSkip to conversation

sched_rt: don't start timer when rt bandwidth disabled

PATCH RESEND In review Hiroshi Shimamoto 2 participants 2 messages Feb 25, 2009

lore
Share & tools
lore
#0 lore raw

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.

---
 kernel/sched.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/sched.c +1 -1
index 4484f9c..9e49ac8 100644
@@ -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
#1 lore raw

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.

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
index 4484f9c..9e49ac8 100644
@@ -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))