@@ -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 */
@@ -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;
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(-)