WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] _csched_cpu_pick(): simplify sched_smt_po

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] _csched_cpu_pick(): simplify sched_smt_power_savings dependent condition
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Sun, 20 Mar 2011 06:40:19 +0000
Delivery-date: Sat, 19 Mar 2011 23:41:59 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxxxx>
# Date 1300123211 0
# Node ID 9f6dec0d25cdef647b60286b99e8beb39b4d91cd
# Parent  77bb4be5c95430ee3bad473f1c791affaa517034
_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@xxxxxxxxxx>
---


diff -r 77bb4be5c954 -r 9f6dec0d25cd xen/common/sched_credit.c
--- a/xen/common/sched_credit.c Mon Mar 14 17:19:47 2011 +0000
+++ b/xen/common/sched_credit.c Mon Mar 14 17:20:11 2011 +0000
@@ -526,10 +526,9 @@
         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);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] _csched_cpu_pick(): simplify sched_smt_power_savings dependent condition, Xen patchbot-unstable <=