[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 25/60] xen: add sched_unit_pause_nosync() and sched_unit_unpause()



The credit scheduler calls vcpu_pause_nosync() and vcpu_unpause()
today. Add sched_unit_pause_nosync() and sched_unit_unpause() to
perform the same operations on scheduler units instead.

Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
---
 xen/common/sched_credit.c  |  6 +++---
 xen/include/xen/sched-if.h | 10 ++++++++++
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 0bc6a87d30..05df9e54ac 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -1071,7 +1071,7 @@ csched_unit_remove(const struct scheduler *ops, struct 
sched_unit *unit)
     if ( test_and_clear_bit(CSCHED_FLAG_UNIT_PARKED, &svc->flags) )
     {
         SCHED_STAT_CRANK(unit_unpark);
-        vcpu_unpause(svc->unit->vcpu);
+        sched_unit_unpause(svc->unit);
     }
 
     spin_lock_irq(&prv->lock);
@@ -1521,7 +1521,7 @@ csched_acct(void* dummy)
                      !test_and_set_bit(CSCHED_FLAG_UNIT_PARKED, &svc->flags) )
                 {
                     SCHED_STAT_CRANK(unit_park);
-                    vcpu_pause_nosync(svc->unit->vcpu);
+                    sched_unit_pause_nosync(svc->unit);
                 }
 
                 /* Lower bound on credits */
@@ -1545,7 +1545,7 @@ csched_acct(void* dummy)
                      * if it is woken up here.
                      */
                     SCHED_STAT_CRANK(unit_unpark);
-                    vcpu_unpause(svc->unit->vcpu);
+                    sched_unit_unpause(svc->unit);
                     clear_bit(CSCHED_FLAG_UNIT_PARKED, &svc->flags);
                 }
 
diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h
index c5bc0b689c..ca70ffb7e9 100644
--- a/xen/include/xen/sched-if.h
+++ b/xen/include/xen/sched-if.h
@@ -426,6 +426,16 @@ static inline int sched_adjust_cpupool(const struct 
scheduler *s,
     return s->adjust_global ? s->adjust_global(s, op) : 0;
 }
 
+static inline void sched_unit_pause_nosync(struct sched_unit *unit)
+{
+    vcpu_pause_nosync(unit->vcpu);
+}
+
+static inline void sched_unit_unpause(struct sched_unit *unit)
+{
+    vcpu_unpause(unit->vcpu);
+}
+
 #define REGISTER_SCHEDULER(x) static const struct scheduler *x##_entry \
   __used_section(".data.schedulers") = &x;
 
-- 
2.16.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.