[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH RFC V2 23/45] xen: add sched_item_pause_nosync() and sched_item_unpause()
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@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 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 295101f9ef..65e2c3bba8 100644 --- a/xen/include/xen/sched-if.h +++ b/xen/include/xen/sched-if.h @@ -451,6 +451,16 @@ static inline int sched_adjust_cpupool(const struct scheduler *s, return 0; } +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; -- 2.16.4 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |