Skip to contentSkip to conversation

sched: test below 0 on unsigned sysctl_sched_rt_period

PATCH In review roel kluin 3 participants 5 messages Jul 22, 2008 – Jul 28, 2008

lore
Share & tools
lore

roel kluin

author
#0 lore raw

PATCH 1/9 sched: test below 0 on unsigned sysctl_sched_rt_period

Peter, you added the test in global_rt_runtime(), in commit d0b27fa77854b149ad4af08b0fe47fe712a47ade
could you take a look at it and tell whether this test should be replaced by something else?

The patch was only checkpatch tested
---
sysctl_sched_rt_period is unsigned so the test doesn't work. state_filter is an unsigned long so the test didn't work

---

kernel/sched.c +1 -4
index 99e6d85..2030340 100644
@@ -832,9 +832,6 @@ static inline u64 global_rt_period(void)
 
 static inline u64 global_rt_runtime(void)
 {
-	if (sysctl_sched_rt_period < 0)
-		return RUNTIME_INF;
-
 	return (u64)sysctl_sched_rt_runtime * NSEC_PER_USEC;
 }
 
@@ -5707,7 +5704,7 @@ void show_state_filter(unsigned long state_filter)
 	/*
 	 * Only show locks if all tasks are dumped:
 	 */
-	if (state_filter == -1)
+	if (state_filter == -1ul)
 		debug_show_all_locks();
 }
 
#1 lore raw
Quoted 17 lines · roel kluin

Peter, you added the test in global_rt_runtime(), in commit d0b27fa77854b149ad4af08b0fe47fe712a47ade
could you take a look at it and tell whether this test should be replaced by something else?

The patch was only checkpatch tested
---
sysctl_sched_rt_period is unsigned so the test doesn't work. state_filter is an unsigned long so the test didn't work

---

kernel/sched.c +0 -0
index 99e6d85..2030340 100644

kernel/sched.c static inline u64 global_rt_period(void) · line 836

Quoted 5 lines
kernel/sched.c +0 -2
@@ -832,9 +832,6 @@ static inline u64 global_rt_period(void)
 
 static inline u64 global_rt_runtime(void)
 {
-	if (sysctl_sched_rt_period < 0)
-		return RUNTIME_INF;

Gah, I'm a moron. That should read:

if (sysctl_sched_rt_runtime < 0)

Care to send a patch to fix it?

Thanks for spotting this!

author
#2 lore raw

PATCH 1/1 sched: Test runtime rather than period in global_rt_runtime()

Quoted 11 lines · Peter Zijlstra

Review

Quoted 6 lines · roel kluin

Peter, you added the test in global_rt_runtime(), in commit d0b27fa77854b149ad4af08b0fe47fe712a47ade
could you take a look at it and tell whether this test should be replaced by something else?

(quoted diff) +0 -1
-	if (sysctl_sched_rt_period < 0)

Gah, I'm a moron. That should read:

if (sysctl_sched_rt_runtime < 0)

---
Test runtime rather than period

---

kernel/sched.c +1 -1
index 99e6d85..a73c783 100644
@@ -832,7 +832,7 @@ static inline u64 global_rt_period(void)
 
 static inline u64 global_rt_runtime(void)
 {
-	if (sysctl_sched_rt_period < 0)
+	if (sysctl_sched_rt_runtime < 0)
 		return RUNTIME_INF;
 
 	return (u64)sysctl_sched_rt_runtime * NSEC_PER_USEC;
Acked-by on v1 1/1
#3 lore raw

Re: [PATCH] sched: Test runtime rather than period in global_rt_runtime()

Quoted 7 lines · roel kluin
Quoted 5 lines · Peter Zijlstra
Quoted 4 lines · roel kluin

Peter, you added the test in global_rt_runtime(), in commit d0b27fa77854b149ad4af08b0fe47fe712a47ade
could you take a look at it and tell whether this test should be replaced by something else?

Quoted 5 lines
Quoted 5 lines

kernel/sched.c static inline u64 global_rt_period(void) · line 835

Quoted 1 line
kernel/sched.c +0 -1
-	if (sysctl_sched_rt_period < 0)

Gah, I'm a moron. That should read:

if (sysctl_sched_rt_runtime < 0)

Thanks!

Quoted 19 lines

---
Test runtime rather than period

---

kernel/sched.c +1 -1
index 99e6d85..a73c783 100644
@@ -832,7 +832,7 @@ static inline u64 global_rt_period(void)
 
 static inline u64 global_rt_runtime(void)
 {
-	if (sysctl_sched_rt_period < 0)
+	if (sysctl_sched_rt_runtime < 0)
 		return RUNTIME_INF;
 
 	return (u64)sysctl_sched_rt_runtime * NSEC_PER_USEC;
Applied
#4 lore raw

Re: [PATCH] sched: Test runtime rather than period in global_rt_runtime()

Quoted 10 lines · Peter Zijlstra
Quoted 9 lines · roel kluin
Quoted 7 lines · Peter Zijlstra
Quoted 6 lines · roel kluin

Peter, you added the test in global_rt_runtime(), in commit d0b27fa77854b149ad4af08b0fe47fe712a47ade
could you take a look at it and tell whether this test should be replaced by something else?

kernel/sched.c +0 -1
-	if (sysctl_sched_rt_period < 0)
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines

Gah, I'm a moron. That should read:

if (sysctl_sched_rt_runtime < 0)

Thanks!

applied to tip/sched/urgent - thanks!

Ingo