Skip to content

Commit a1963b8

Browse files
Wanpeng LiIngo Molnar
authored andcommitted
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 <wanpeng.li@linux.intel.com> [ Improved the changelog. ] Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Juri Lelli <juri.lelli@arm.com> Link: http://lkml.kernel.org/r/1426590931-4639-2-git-send-email-wanpeng.li@linux.intel.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent bd4bde1 commit a1963b8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

kernel/sched/core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7804,7 +7804,7 @@ static int sched_rt_global_constraints(void)
78047804
}
78057805
#endif /* CONFIG_RT_GROUP_SCHED */
78067806

7807-
static int sched_dl_global_constraints(void)
7807+
static int sched_dl_global_validate(void)
78087808
{
78097809
u64 runtime = global_rt_runtime();
78107810
u64 period = global_rt_period();
@@ -7905,11 +7905,11 @@ int sched_rt_handler(struct ctl_table *table, int write,
79057905
if (ret)
79067906
goto undo;
79077907

7908-
ret = sched_rt_global_constraints();
7908+
ret = sched_dl_global_validate();
79097909
if (ret)
79107910
goto undo;
79117911

7912-
ret = sched_dl_global_constraints();
7912+
ret = sched_rt_global_constraints();
79137913
if (ret)
79147914
goto undo;
79157915

0 commit comments

Comments
 (0)