lkml.org 
[lkml]   [2014]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sched/core: fix sched_rt_global_validate
On Fri, Jan 31, 2014 at 05:43:27PM +0100, Juri Lelli wrote:
> Don't compare sysctl_sched_rt_runtime against sysctl_sched_rt_period if
> the former is equal to RUNTIME_INF, otherwise disabling -rt bandwidth
> management always fails.
>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Signed-off-by: Juri Lelli <juri.lelli@gmail.com>
> ---
> kernel/sched/core.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 210a12a..5c0a304 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -7477,7 +7477,8 @@ static int sched_rt_global_validate(void)
> if (sysctl_sched_rt_period <= 0)
> return -EINVAL;
>
> - if (sysctl_sched_rt_runtime > sysctl_sched_rt_period)
> + if ((sysctl_sched_rt_runtime != RUNTIME_INF) &&
> + (sysctl_sched_rt_runtime > sysctl_sched_rt_period))
> return -EINVAL;

Won't this be caught by the test above?

#define RUNTIME_INF ((u64)~0ULL)

which means that if sysctl_sched_rt_runtime is set to RUNTIME_INF, it will
trigger on the previous test, and the first part of this test will always
be true.

Or have I suffered catastrophic monday-morning braindamage?

--
Henrik Austad


\
 
 \ /
  Last update: 2014-02-03 11:41    [W:0.053 / U:0.632 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site