|
@@ -7675,6 +7675,17 @@ static int tg_set_rt_bandwidth(struct task_group *tg,
|
|
{
|
|
{
|
|
int i, err = 0;
|
|
int i, err = 0;
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * Disallowing the root group RT runtime is BAD, it would disallow the
|
|
|
|
+ * kernel creating (and or operating) RT threads.
|
|
|
|
+ */
|
|
|
|
+ if (tg == &root_task_group && rt_runtime == 0)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
|
|
+ /* No period doesn't make any sense. */
|
|
|
|
+ if (rt_period == 0)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
mutex_lock(&rt_constraints_mutex);
|
|
mutex_lock(&rt_constraints_mutex);
|
|
read_lock(&tasklist_lock);
|
|
read_lock(&tasklist_lock);
|
|
err = __rt_schedulable(tg, rt_period, rt_runtime);
|
|
err = __rt_schedulable(tg, rt_period, rt_runtime);
|
|
@@ -7731,9 +7742,6 @@ static int sched_group_set_rt_period(struct task_group *tg, long rt_period_us)
|
|
rt_period = (u64)rt_period_us * NSEC_PER_USEC;
|
|
rt_period = (u64)rt_period_us * NSEC_PER_USEC;
|
|
rt_runtime = tg->rt_bandwidth.rt_runtime;
|
|
rt_runtime = tg->rt_bandwidth.rt_runtime;
|
|
|
|
|
|
- if (rt_period == 0)
|
|
|
|
- return -EINVAL;
|
|
|
|
-
|
|
|
|
return tg_set_rt_bandwidth(tg, rt_period, rt_runtime);
|
|
return tg_set_rt_bandwidth(tg, rt_period, rt_runtime);
|
|
}
|
|
}
|
|
|
|
|