sched/deadline: Fix rt runtime corruption when dl fails its global constraints

One version of sched_rt_global_constaints() (the !rt-cgroup one)
changes state, therefore if we fail the later sched_dl_global_constraints()
call the state is left in an inconsistent state.

Fix this by changing the order of the calls.

Signed-off-by: Wanpeng Li <[email protected]>
[ Improved the changelog. ]
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Acked-by: Juri Lelli <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
Wanpeng Li 2015-03-17 19:15:31 +08:00 • committed by Ingo Molnar
commit a1963b81de

View file

@ -7804,7 +7804,7 @@ static int sched_rt_global_constraints(void)
}
#endif /* CONFIG_RT_GROUP_SCHED */
static int sched_dl_global_constraints(void)
static int sched_dl_global_validate(void)
{
u64 runtime = global_rt_runtime();
u64 period = global_rt_period();
@ -7905,11 +7905,11 @@ int sched_rt_handler(struct ctl_table *table, int write,
if (ret)
goto undo;
ret = sched_rt_global_constraints();
ret = sched_dl_global_validate();
if (ret)
goto undo;
ret = sched_dl_global_constraints();
ret = sched_rt_global_constraints();
if (ret)
goto undo;