Skip to contentSkip to conversation

sched: update sched_rt_[period|runtime]_us correctly

PATCH New Yong Zhang 1 participant 1 message Sep 30, 2013 Scheduler

lore
Share & tools
lore

Yong Zhang

author
#0 lore raw

PATCH 1/1 sched: update sched_rt_[period|runtime]_us correctly

From: Yong Zhang <[email protected]>

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.

Cc Ingo Molnar <[email protected]>
Cc Peter Zijlstra <[email protected]>
---
 kernel/sched/core.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
kernel/sched/core.c +1 -5
index 5ac63c9..c77d298 100644
@@ -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;
 }
Signature · 1 line
1.7.9.5