From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753347AbbC0Lor (ORCPT ); Fri, 27 Mar 2015 07:44:47 -0400 Received: from terminus.zytor.com ([198.137.202.10]:37216 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753281AbbC0Lon (ORCPT ); Fri, 27 Mar 2015 07:44:43 -0400 Date: Fri, 27 Mar 2015 04:44:07 -0700 From: tip-bot for Wanpeng Li Message-ID: Cc: wanpeng.li@linux.intel.com, juri.lelli@arm.com, hpa@zytor.com, peterz@infradead.org, mingo@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org Reply-To: wanpeng.li@linux.intel.com, mingo@kernel.org, hpa@zytor.com, peterz@infradead.org, juri.lelli@arm.com, tglx@linutronix.de, linux-kernel@vger.kernel.org In-Reply-To: <1426590931-4639-2-git-send-email-wanpeng.li@linux.intel.com> References: <1426590931-4639-2-git-send-email-wanpeng.li@linux.intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] sched/deadline: Fix rt runtime corruption when dl fails its global constraints Git-Commit-ID: a1963b81deec54c113e770b0020e5f1c3188a087 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: a1963b81deec54c113e770b0020e5f1c3188a087 Gitweb: http://git.kernel.org/tip/a1963b81deec54c113e770b0020e5f1c3188a087 Author: Wanpeng Li AuthorDate: Tue, 17 Mar 2015 19:15:31 +0800 Committer: Ingo Molnar CommitDate: Fri, 27 Mar 2015 09:36:15 +0100 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 [ Improved the changelog. ] Signed-off-by: Peter Zijlstra (Intel) Acked-by: Juri Lelli Link: http://lkml.kernel.org/r/1426590931-4639-2-git-send-email-wanpeng.li@linux.intel.com Signed-off-by: Ingo Molnar --- kernel/sched/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 043e2a1..4b3b688 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -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;