Jan Beulich
2011-Mar-14  17:05 UTC
[Xen-devel] [PATCH 3/3] _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>
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -526,10 +526,9 @@ _csched_cpu_pick(const struct scheduler 
         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-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
Seemingly Similar Threads
- [PATCH] xen,credit1: Add variable timeslice
- [PATCH v2] xen: sched_credit: filter node-affinity mask against online cpus
- [PATCH] xenpm: make argument parsing and error handling more consistent
- [PATCH] properly __initdata-annotate command line option string buffers
- [PATCH 0 of 2] Scheduler: Implement yield for credit scheduler
