sched: test below 0 on unsigned sysctl_sched_rt_period
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
@@ -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 (); }
Quoted 17 lines · roel kluin
Peter, you added the test in
global_rt_runtime(), in commitd0b27fa77854b149ad4af08b0fe47fe712a47ade
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_periodis unsigned so the test doesn't work.state_filteris an unsigned long so the test didn't workSigned-off-by Roel Kluin <[email protected]>---
kernel/sched.c +0
-0
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!
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 commitd0b27fa77854b149ad4af08b0fe47fe712a47ade
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
@@ -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 ;
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 commitd0b27fa77854b149ad4af08b0fe47fe712a47ade
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 periodSigned-off-by Roel Kluin <[email protected]>---
kernel/sched.c +1
-1@@ -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 ;
Ingo Molnar
AppliedRe: [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 commitd0b27fa77854b149ad4af08b0fe47fe712a47ade
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!
Acked-by Peter Zijlstra <[email protected]>
applied to tip/sched/urgent - thanks!
Ingo