diff mbox series

[RFC,29/49] xen: add sched_item_pause_nosync() and sched_item_unpause()

Message ID 20190329150934.17694-30-jgross@suse.com (mailing list archive)
State Superseded
Headers show
Series xen: add core scheduling support | expand

Commit Message

Jürgen Groß March 29, 2019, 3:09 p.m. UTC
The credit scheduler calls vcpu_pause_nosync() and vcpu_unpause()
today. Add sched_item_pause_nosync() and sched_item_unpause() to
perform the same operations on scheduler items instead.

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

Patch

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index babccb69f7..9db5c3fc71 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -1080,7 +1080,7 @@  csched_item_remove(const struct scheduler *ops, struct sched_item *item)
     if ( test_and_clear_bit(CSCHED_FLAG_ITEM_PARKED, &svc->flags) )
     {
         SCHED_STAT_CRANK(item_unpark);
-        vcpu_unpause(svc->item->vcpu);
+        sched_item_unpause(svc->item);
     }
 
     spin_lock_irq(&prv->lock);
@@ -1530,7 +1530,7 @@  csched_acct(void* dummy)
                      !test_and_set_bit(CSCHED_FLAG_ITEM_PARKED, &svc->flags) )
                 {
                     SCHED_STAT_CRANK(item_park);
-                    vcpu_pause_nosync(svc->item->vcpu);
+                    sched_item_pause_nosync(svc->item);
                 }
 
                 /* Lower bound on credits */
@@ -1554,7 +1554,7 @@  csched_acct(void* dummy)
                      * if it is woken up here.
                      */
                     SCHED_STAT_CRANK(item_unpark);
-                    vcpu_unpause(svc->item->vcpu);
+                    sched_item_unpause(svc->item);
                 }
 
                 /* Upper bound on credits means ITEM stops earning */
diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h
index 5cacede473..18134c7972 100644
--- a/xen/include/xen/sched-if.h
+++ b/xen/include/xen/sched-if.h
@@ -308,6 +308,16 @@  static inline void sched_free_domdata(const struct scheduler *s,
         ASSERT(!data);
 }
 
+static inline void sched_item_pause_nosync(struct sched_item *item)
+{
+    vcpu_pause_nosync(item->vcpu);
+}
+
+static inline void sched_item_unpause(struct sched_item *item)
+{
+    vcpu_unpause(item->vcpu);
+}
+
 #define REGISTER_SCHEDULER(x) static const struct scheduler *x##_entry \
   __used_section(".data.schedulers") = &x;