Skip to contentSkip to conversation

Sched: Change type of 'overrun' from int to u64

PATCH In review Puranjay Mohan 2 participants 2 messages Jul 5, 2019 Scheduler

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Sched: Change type of 'overrun' from int to u64

Callers of hrtimer_forward_now() should save the return value in u64. function sched_rt_period_timer() stores
it in variable 'overrun' of type int
change type of overrun from int to u64 to solve the issue.

Signed-off-by Puranjay Mohan <puranjay12 at gmail.com>
---
 kernel/sched/rt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/rt.c +1 -1
index 1e6b909dca36..f5d3893914f5 100644
@@ -19,7 +19,7 @@ static enum hrtimer_restart sched_rt_period_timer(struct hrtimer *timer)
 	struct rt_bandwidth *rt_b =
 		container_of(timer, struct rt_bandwidth, rt_period_timer);
 	int idle = 0;
-	int overrun;
+	u64 overrun;
 
 	raw_spin_lock(&rt_b->rt_runtime_lock);
 	for (;;) {
Signature · 1 line
2.21.0
maintainer
#1 lore raw
Quoted 4 lines · Puranjay Mohan

Callers of hrtimer_forward_now() should save the return value in u64. function sched_rt_period_timer() stores
it in variable 'overrun' of type int
change type of overrun from int to u64 to solve the issue.

Is there an actual issue? If we've missed _that_ many periods, something is really buggered.

Quoted 1 line

From a code consistency PoV this patch makes sense, but I don't think

there anything really wrong with the current code.

Quoted 21 lines
Signed-off-by Puranjay Mohan <puranjay12 at gmail.com>
---
 kernel/sched/rt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/rt.c +1 -1
index 1e6b909dca36..f5d3893914f5 100644
@@ -19,7 +19,7 @@ static enum hrtimer_restart sched_rt_period_timer(struct hrtimer *timer)
 	struct rt_bandwidth *rt_b =
 		container_of(timer, struct rt_bandwidth, rt_period_timer);
 	int idle = 0;
-	int overrun;
+	u64 overrun;
 
 	raw_spin_lock(&rt_b->rt_runtime_lock);
 	for (;;) {
Signature · 1 line
2.21.0