lkml.org 
[lkml]   [2013]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] sched: update sched_rt_[period|runtime]_us correctly
Date
From: Yong Zhang <yong.zhang@windriver.com>

The code fails to update tg->rt_bandwidth.[rt_period | rt_runtime]
if we have RT_GROUP_SCHED enabled. And if we lower the value of
sched_rt_runtime_us, we get error as "write error: Invalid argument".

Fix it by calling tg_set_rt_bandwidth() instead when setting
sched_rt_[period|runtime]_us.

Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
---
kernel/sched/core.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 5ac63c9..c77d298 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -7035,11 +7035,7 @@ static int sched_rt_global_constraints(void)
if (runtime > period && runtime != RUNTIME_INF)
return -EINVAL;

- mutex_lock(&rt_constraints_mutex);
- read_lock(&tasklist_lock);
- ret = __rt_schedulable(NULL, 0, 0);
- read_unlock(&tasklist_lock);
- mutex_unlock(&rt_constraints_mutex);
+ ret = tg_set_rt_bandwidth(&root_task_group, period, runtime);

return ret;
}
--
1.7.9.5


\
 
 \ /
  Last update: 2013-09-30 11:21    [W:0.020 / U:0.756 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site