public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/9] sched: test below 0 on unsigned sysctl_sched_rt_period
@ 2008-07-22  0:28 roel kluin
  2008-07-22  9:08 ` Peter Zijlstra
  0 siblings, 1 reply; 5+ messages in thread
From: roel kluin @ 2008-07-22  0:28 UTC (permalink / raw)
  To: mingo, rml, a.p.zijlstra; +Cc: linux-kernel

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

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/kernel/sched.c b/kernel/sched.c
index 99e6d85..2030340 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -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();
 }
 

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/9] sched: test below 0 on unsigned sysctl_sched_rt_period
  2008-07-22  0:28 [PATCH 1/9] sched: test below 0 on unsigned sysctl_sched_rt_period roel kluin
@ 2008-07-22  9:08 ` Peter Zijlstra
  2008-07-22 20:51   ` [PATCH] sched: Test runtime rather than period in global_rt_runtime() roel kluin
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Zijlstra @ 2008-07-22  9:08 UTC (permalink / raw)
  To: roel kluin; +Cc: mingo, rml, linux-kernel

On Mon, 2008-07-21 at 20:28 -0400, roel kluin wrote:
> 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
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> diff --git a/kernel/sched.c b/kernel/sched.c
> index 99e6d85..2030340 100644
> --- a/kernel/sched.c
> +++ b/kernel/sched.c
> @@ -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!



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] sched: Test runtime rather than period in global_rt_runtime()
  2008-07-22  9:08 ` Peter Zijlstra
@ 2008-07-22 20:51   ` roel kluin
  2008-07-23  6:25     ` Peter Zijlstra
  0 siblings, 1 reply; 5+ messages in thread
From: roel kluin @ 2008-07-22 20:51 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: mingo, rml, linux-kernel

Peter Zijlstra wrote:
> On Mon, 2008-07-21 at 20:28 -0400, roel kluin wrote:
>> 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?

>> -	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

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/kernel/sched.c b/kernel/sched.c
index 99e6d85..a73c783 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -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;


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] sched: Test runtime rather than period in global_rt_runtime()
  2008-07-22 20:51   ` [PATCH] sched: Test runtime rather than period in global_rt_runtime() roel kluin
@ 2008-07-23  6:25     ` Peter Zijlstra
  2008-07-28 14:04       ` Ingo Molnar
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Zijlstra @ 2008-07-23  6:25 UTC (permalink / raw)
  To: roel kluin; +Cc: mingo, rml, linux-kernel

On Tue, 2008-07-22 at 16:51 -0400, roel kluin wrote:
> Peter Zijlstra wrote:
> > On Mon, 2008-07-21 at 20:28 -0400, roel kluin wrote:
> >> 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?
> 
> >> -	if (sysctl_sched_rt_period < 0)
> 
> > Gah, I'm a moron. That should read:
> > 
> >   if (sysctl_sched_rt_runtime < 0)

Thanks!

Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>

> ---
> Test runtime rather than period
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> diff --git a/kernel/sched.c b/kernel/sched.c
> index 99e6d85..a73c783 100644
> --- a/kernel/sched.c
> +++ b/kernel/sched.c
> @@ -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;
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] sched: Test runtime rather than period in global_rt_runtime()
  2008-07-23  6:25     ` Peter Zijlstra
@ 2008-07-28 14:04       ` Ingo Molnar
  0 siblings, 0 replies; 5+ messages in thread
From: Ingo Molnar @ 2008-07-28 14:04 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: roel kluin, rml, linux-kernel


* Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:

> On Tue, 2008-07-22 at 16:51 -0400, roel kluin wrote:
> > Peter Zijlstra wrote:
> > > On Mon, 2008-07-21 at 20:28 -0400, roel kluin wrote:
> > >> 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?
> > 
> > >> -	if (sysctl_sched_rt_period < 0)
> > 
> > > Gah, I'm a moron. That should read:
> > > 
> > >   if (sysctl_sched_rt_runtime < 0)
> 
> Thanks!
> 
> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>

applied to tip/sched/urgent - thanks!

	Ingo

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-07-28 14:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-22  0:28 [PATCH 1/9] sched: test below 0 on unsigned sysctl_sched_rt_period roel kluin
2008-07-22  9:08 ` Peter Zijlstra
2008-07-22 20:51   ` [PATCH] sched: Test runtime rather than period in global_rt_runtime() roel kluin
2008-07-23  6:25     ` Peter Zijlstra
2008-07-28 14:04       ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox