aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWanpeng Li <wanpeng.li@linux.intel.com>2015-03-17 07:15:31 -0400
committerIngo Molnar <mingo@kernel.org>2015-03-27 04:36:15 -0400
commita1963b81deec54c113e770b0020e5f1c3188a087 (patch)
tree650cdf63c8f2783bc81be748717a896fcdbdb91b
parentbd4bde14b93cce8fa77765ff709e0be55abdba2c (diff)
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>
-rw-r--r--kernel/sched/core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 043e2a13b8b9..4b3b6887c6b1 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -7804,7 +7804,7 @@ static int sched_rt_global_constraints(void)
7804} 7804}
7805#endif /* CONFIG_RT_GROUP_SCHED */ 7805#endif /* CONFIG_RT_GROUP_SCHED */
7806 7806
7807static int sched_dl_global_constraints(void) 7807static int sched_dl_global_validate(void)
7808{ 7808{
7809 u64 runtime = global_rt_runtime(); 7809 u64 runtime = global_rt_runtime();
7810 u64 period = global_rt_period(); 7810 u64 period = global_rt_period();
@@ -7905,11 +7905,11 @@ int sched_rt_handler(struct ctl_table *table, int write,
7905 if (ret) 7905 if (ret)
7906 goto undo; 7906 goto undo;
7907 7907
7908 ret = sched_rt_global_constraints(); 7908 ret = sched_dl_global_validate();
7909 if (ret) 7909 if (ret)
7910 goto undo; 7910 goto undo;
7911 7911
7912 ret = sched_dl_global_constraints(); 7912 ret = sched_rt_global_constraints();
7913 if (ret) 7913 if (ret)
7914 goto undo; 7914 goto undo;
7915 7915