debuggers.hg

changeset 21981:93074767205e

scheduler: Add a per-scheduler yield callback

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Aug 09 16:35:27 2010 +0100 (2010-08-09)
parents befd1814c0a2
children fc29e13f669d
files xen/common/schedule.c xen/include/xen/sched-if.h
line diff
     1.1 --- a/xen/common/schedule.c	Mon Aug 09 16:33:45 2010 +0100
     1.2 +++ b/xen/common/schedule.c	Mon Aug 09 16:35:27 2010 +0100
     1.3 @@ -642,6 +642,12 @@ static long do_poll(struct sched_poll *s
     1.4  /* Voluntarily yield the processor for this allocation. */
     1.5  static long do_yield(void)
     1.6  {
     1.7 +    struct vcpu * v=current;
     1.8 +
     1.9 +    vcpu_schedule_lock_irq(v);
    1.10 +    SCHED_OP(VCPU2OP(v), yield, v);
    1.11 +    vcpu_schedule_unlock_irq(v);
    1.12 +
    1.13      TRACE_2D(TRC_SCHED_YIELD, current->domain->domain_id, current->vcpu_id);
    1.14      raise_softirq(SCHEDULE_SOFTIRQ);
    1.15      return 0;
     2.1 --- a/xen/include/xen/sched-if.h	Mon Aug 09 16:33:45 2010 +0100
     2.2 +++ b/xen/include/xen/sched-if.h	Mon Aug 09 16:35:27 2010 +0100
     2.3 @@ -107,6 +107,7 @@ struct scheduler {
     2.4  
     2.5      void         (*sleep)          (const struct scheduler *, struct vcpu *);
     2.6      void         (*wake)           (const struct scheduler *, struct vcpu *);
     2.7 +    void         (*yield)          (const struct scheduler *, struct vcpu *);
     2.8      void         (*context_saved)  (const struct scheduler *, struct vcpu *);
     2.9  
    2.10      struct task_slice (*do_schedule) (const struct scheduler *, s_time_t,