debuggers.hg

changeset 21214:5cd44772fd21

credit2: Add context_saved scheduler callback

Because credit2 shares a runqueue between several cpus, it needs
to know when a scheduled-out process has finally been context-switched
away so that it can be added to the runqueue again. (Otherwise it may
be grabbed by another processor before the context has been properly
saved.)

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Apr 14 12:03:27 2010 +0100 (2010-04-14)
parents ae08db793feb
children 0387e6ce1540
files xen/common/schedule.c xen/include/xen/sched-if.h
line diff
     1.1 --- a/xen/common/schedule.c	Wed Apr 14 11:56:54 2010 +0100
     1.2 +++ b/xen/common/schedule.c	Wed Apr 14 12:03:27 2010 +0100
     1.3 @@ -885,6 +885,8 @@ void context_saved(struct vcpu *prev)
     1.4      /* Check for migration request /after/ clearing running flag. */
     1.5      smp_mb();
     1.6  
     1.7 +    SCHED_OP(context_saved, prev);
     1.8 +
     1.9      if ( unlikely(test_bit(_VPF_migrating, &prev->pause_flags)) )
    1.10          vcpu_migrate(prev);
    1.11  }
     2.1 --- a/xen/include/xen/sched-if.h	Wed Apr 14 11:56:54 2010 +0100
     2.2 +++ b/xen/include/xen/sched-if.h	Wed Apr 14 12:03:27 2010 +0100
     2.3 @@ -70,6 +70,7 @@ struct scheduler {
     2.4  
     2.5      void         (*sleep)          (struct vcpu *);
     2.6      void         (*wake)           (struct vcpu *);
     2.7 +    void         (*context_saved)  (struct vcpu *);
     2.8  
     2.9      struct task_slice (*do_schedule) (s_time_t);
    2.10