* [PATCH] sched/deadline: Switch CPU's presence test order
@ 2014-02-24 10:47 Juri Lelli
2014-02-27 13:31 ` [tip:sched/urgent] sched/deadline: Switch CPU' s " tip-bot for Juri Lelli
0 siblings, 1 reply; 2+ messages in thread
From: Juri Lelli @ 2014-02-24 10:47 UTC (permalink / raw)
To: mingo, peterz, tglx
Cc: linux-kernel, boris.ostrovsky, konrad.wilk, rostedt, Juri Lelli
Commit 82b9580 (sched/deadline: Test for CPU's presence explicitly)
changed how we check if a CPU returned by cpudeadline machinery is
valid. But, we don't want to call cpu_present() if best_cpu is
equal to -1. So, switch the order of tests inside WARN_ON().
Signed-off-by: Juri Lelli <juri.lelli@gmail.com>
---
kernel/sched/cpudeadline.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/cpudeadline.c b/kernel/sched/cpudeadline.c
index 5b8838b..5b9bb42 100644
--- a/kernel/sched/cpudeadline.c
+++ b/kernel/sched/cpudeadline.c
@@ -70,7 +70,7 @@ static void cpudl_heapify(struct cpudl *cp, int idx)
static void cpudl_change_key(struct cpudl *cp, int idx, u64 new_dl)
{
- WARN_ON(!cpu_present(idx) || idx == IDX_INVALID);
+ WARN_ON(idx == IDX_INVALID || !cpu_present(idx));
if (dl_time_before(new_dl, cp->elements[idx].dl)) {
cp->elements[idx].dl = new_dl;
@@ -117,7 +117,7 @@ int cpudl_find(struct cpudl *cp, struct task_struct *p,
}
out:
- WARN_ON(!cpu_present(best_cpu) && best_cpu != -1);
+ WARN_ON(best_cpu != -1 && !cpu_present(best_cpu));
return best_cpu;
}
--
1.7.9.5
^ permalink raw reply [flat|nested] 2+ messages in thread
* [tip:sched/urgent] sched/deadline: Switch CPU' s presence test order
2014-02-24 10:47 [PATCH] sched/deadline: Switch CPU's presence test order Juri Lelli
@ 2014-02-27 13:31 ` tip-bot for Juri Lelli
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Juri Lelli @ 2014-02-27 13:31 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, peterz, tglx, juri.lelli
Commit-ID: eec751ed41a0ae7e92a43c33a458d7bd1b941631
Gitweb: http://git.kernel.org/tip/eec751ed41a0ae7e92a43c33a458d7bd1b941631
Author: Juri Lelli <juri.lelli@gmail.com>
AuthorDate: Mon, 24 Feb 2014 11:47:12 +0100
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 27 Feb 2014 12:29:40 +0100
sched/deadline: Switch CPU's presence test order
Commit 82b9580 ("sched/deadline: Test for CPU's presence explicitly")
changed how we check if a CPU returned by cpudeadline machinery is
valid. But, we don't want to call cpu_present() if best_cpu is
equal to -1. So, switch the order of tests inside WARN_ON().
Signed-off-by: Juri Lelli <juri.lelli@gmail.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: boris.ostrovsky@oracle.com
Cc: konrad.wilk@oracle.com
Cc: rostedt@goodmis.org
Link: http://lkml.kernel.org/r/1393238832-9100-1-git-send-email-juri.lelli@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/sched/cpudeadline.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/cpudeadline.c b/kernel/sched/cpudeadline.c
index 5b8838b..5b9bb42 100644
--- a/kernel/sched/cpudeadline.c
+++ b/kernel/sched/cpudeadline.c
@@ -70,7 +70,7 @@ static void cpudl_heapify(struct cpudl *cp, int idx)
static void cpudl_change_key(struct cpudl *cp, int idx, u64 new_dl)
{
- WARN_ON(!cpu_present(idx) || idx == IDX_INVALID);
+ WARN_ON(idx == IDX_INVALID || !cpu_present(idx));
if (dl_time_before(new_dl, cp->elements[idx].dl)) {
cp->elements[idx].dl = new_dl;
@@ -117,7 +117,7 @@ int cpudl_find(struct cpudl *cp, struct task_struct *p,
}
out:
- WARN_ON(!cpu_present(best_cpu) && best_cpu != -1);
+ WARN_ON(best_cpu != -1 && !cpu_present(best_cpu));
return best_cpu;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-02-27 13:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-24 10:47 [PATCH] sched/deadline: Switch CPU's presence test order Juri Lelli
2014-02-27 13:31 ` [tip:sched/urgent] sched/deadline: Switch CPU' s " tip-bot for Juri Lelli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®