All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] credit: generalize __vcpu_has_soft_affinity()
@ 2015-03-06  7:36 Jan Beulich
  2015-03-06  8:39 ` Dario Faggioli
  2015-03-06  9:53 ` George Dunlap
  0 siblings, 2 replies; 16+ messages in thread
From: Jan Beulich @ 2015-03-06  7:36 UTC (permalink / raw)
  To: xen-devel; +Cc: George Dunlap, Dario Faggioli

[-- Attachment #1: Type: text/plain, Size: 1169 bytes --]

As pointed out in the discussion of the patch at
http://lists.xenproject.org/archives/html/xen-devel/2015-02/msg03256.html 
generalizing the conditions here means code elsewhere doesn't need to
take into consideration internals of how load balancing in the credit
scheduler works.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v2: Use VCPU2ONLINE(vc) (or really an open coded variant thereof)
    instead of cpu_online_map (suggested by Dario).

--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -292,11 +292,10 @@ __runq_remove(struct csched_vcpu *svc)
 static inline int __vcpu_has_soft_affinity(const struct vcpu *vc,
                                            const cpumask_t *mask)
 {
-    if ( cpumask_full(vc->cpu_soft_affinity)
-         || !cpumask_intersects(vc->cpu_soft_affinity, mask) )
-        return 0;
-
-    return 1;
+    return !cpumask_subset(cpupool_online_cpumask(vc->domain->cpupool),
+                           vc->cpu_soft_affinity) &&
+           !cpumask_subset(vc->cpu_soft_affinity, vc->cpu_hard_affinity) &&
+           cpumask_intersects(vc->cpu_soft_affinity, mask);
 }
 
 /*




[-- Attachment #2: credit-has-soft-affinity.patch --]
[-- Type: text/plain, Size: 1211 bytes --]

credit: generalize __vcpu_has_soft_affinity()

As pointed out in the discussion of the patch at
http://lists.xenproject.org/archives/html/xen-devel/2015-02/msg03256.html
generalizing the conditions here means code elsewhere doesn't need to
take into consideration internals of how load balancing in the credit
scheduler works.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v2: Use VCPU2ONLINE(vc) (or really an open coded variant thereof)
    instead of cpu_online_map (suggested by Dario).

--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -292,11 +292,10 @@ __runq_remove(struct csched_vcpu *svc)
 static inline int __vcpu_has_soft_affinity(const struct vcpu *vc,
                                            const cpumask_t *mask)
 {
-    if ( cpumask_full(vc->cpu_soft_affinity)
-         || !cpumask_intersects(vc->cpu_soft_affinity, mask) )
-        return 0;
-
-    return 1;
+    return !cpumask_subset(cpupool_online_cpumask(vc->domain->cpupool),
+                           vc->cpu_soft_affinity) &&
+           !cpumask_subset(vc->cpu_soft_affinity, vc->cpu_hard_affinity) &&
+           cpumask_intersects(vc->cpu_soft_affinity, mask);
 }
 
 /*

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2015-03-06 15:10 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-06  7:36 [PATCH v2] credit: generalize __vcpu_has_soft_affinity() Jan Beulich
2015-03-06  8:39 ` Dario Faggioli
2015-03-06  9:53 ` George Dunlap
2015-03-06 10:16   ` Jan Beulich
2015-03-06 11:32     ` George Dunlap
2015-03-06 11:44       ` Jan Beulich
2015-03-06 12:00         ` George Dunlap
2015-03-06 13:10           ` Jan Beulich
2015-03-06 13:23           ` Dario Faggioli
2015-03-06 13:32             ` Jan Beulich
2015-03-06 13:44               ` Dario Faggioli
2015-03-06 11:12   ` Dario Faggioli
2015-03-06 11:38     ` George Dunlap
2015-03-06 13:31       ` Dario Faggioli
2015-03-06 14:57         ` George Dunlap
2015-03-06 15:10           ` Dario Faggioli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.