aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/sched_credit.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2011-03-14 17:20:11 +0000
committerJan Beulich <jbeulich@novell.com>2011-03-14 17:20:11 +0000
commitc5b9d74246c3fb193431b0dad4da61c2effaab35 (patch)
treea68aa51bfa5db6ea1080554321cc3840e28b42de /xen/common/sched_credit.c
parent32084d00161c849be2c812b1d2ef8b2ce0cbd783 (diff)
downloadxen-c5b9d74246c3fb193431b0dad4da61c2effaab35.tar.gz
xen-c5b9d74246c3fb193431b0dad4da61c2effaab35.tar.bz2
xen-c5b9d74246c3fb193431b0dad4da61c2effaab35.zip
_csched_cpu_pick(): simplify sched_smt_power_savings dependent condition
At least to me, using ?: instead of the (a && ...) || (!a && ...) construct is far easier to grok with a single look. Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'xen/common/sched_credit.c')
-rw-r--r--xen/common/sched_credit.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 1d4d423620..f1e969499f 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -526,10 +526,9 @@ _csched_cpu_pick(const struct scheduler *ops, struct vcpu *vc, bool_t commit)
weight_cpu = cpus_weight(cpu_idlers);
weight_nxt = cpus_weight(nxt_idlers);
/* smt_power_savings: consolidate work rather than spreading it */
- if ( ( sched_smt_power_savings
- && (weight_cpu > weight_nxt) )
- || ( !sched_smt_power_savings
- && (weight_cpu * migrate_factor < weight_nxt) ) )
+ if ( sched_smt_power_savings ?
+ weight_cpu > weight_nxt :
+ weight_cpu * migrate_factor < weight_nxt )
{
cpus_and(nxt_idlers, cpus, nxt_idlers);
spc = CSCHED_PCPU(nxt);