mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Wanpeng Li <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
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
Subject: [tip:sched/core] sched/deadline: Fix rt runtime corruption when dl fails its global constraints
Date: Fri, 27 Mar 2015 04:44:07 -0700	[thread overview]
Message-ID: <tip-a1963b81deec54c113e770b0020e5f1c3188a087@git.kernel.org> (raw)
In-Reply-To: <1426590931-4639-2-git-send-email-wanpeng.li@linux.intel.com>

Commit-ID:  a1963b81deec54c113e770b0020e5f1c3188a087
Gitweb:     http://git.kernel.org/tip/a1963b81deec54c113e770b0020e5f1c3188a087
Author:     Wanpeng Li <wanpeng.li@linux.intel.com>
AuthorDate: Tue, 17 Mar 2015 19:15:31 +0800
Committer:  Ingo Molnar <mingo@kernel.org>
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 <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>
---
 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;
 

  reply	other threads:[~2015-03-27 11:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-17 11:15 [PATCH v3 1/2] sched/deadline: don't need to check throttled status when switched to dl Wanpeng Li
2015-03-17 11:15 ` [PATCH v3 2/2] sched/deadline: fix rt runtime corrupt when dl refuse a smaller bandwidth Wanpeng Li
2015-03-27 11:44   ` tip-bot for Wanpeng Li [this message]
2015-03-19  4:20 ` [PATCH v3 1/2] sched/deadline: don't need to check throttled status when switched to dl Wanpeng Li
2015-03-27 11:43 ` [tip:sched/core] sched/deadline: Avoid a superfluous check tip-bot for Wanpeng Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-a1963b81deec54c113e770b0020e5f1c3188a087@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=hpa@zytor.com \
    --cc=juri.lelli@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=wanpeng.li@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome