ia64/xen-unstable

changeset 10470:ef8cdd1dc836

[SEDF] Fix SEDF defaults to make domain0 take only a fair
equally-weighted share of extratime. Also, hack the short-
blocking logic as otherwise domain0 steals all CPU time
for several seconds after waking from a long sleep.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Sat Jun 17 11:29:35 2006 +0100 (2006-06-17)
parents b025491f0ba8
children 5033ffe8f533
files xen/common/sched_sedf.c
line diff
     1.1 --- a/xen/common/sched_sedf.c	Sat Jun 17 09:19:16 2006 +0100
     1.2 +++ b/xen/common/sched_sedf.c	Sat Jun 17 11:29:35 2006 +0100
     1.3 @@ -360,24 +360,23 @@ static int sedf_init_vcpu(struct vcpu *v
     1.4          INIT_LIST_HEAD(EXTRAQ(v->processor,EXTRA_UTIL_Q));
     1.5      }
     1.6         
     1.7 +    /* Every VCPU gets an equal share of extratime by default. */
     1.8 +    inf->deadl_abs   = 0;
     1.9 +    inf->latency     = 0;
    1.10 +    inf->status      = EXTRA_AWARE | SEDF_ASLEEP;
    1.11 +    inf->extraweight = 1;
    1.12 +
    1.13      if ( v->domain->domain_id == 0 )
    1.14      {
    1.15 -        /*set dom0 to something useful to boot the machine*/
    1.16 +        /* Domain0 gets 75% guaranteed (15ms every 20ms). */
    1.17          inf->period    = MILLISECS(20);
    1.18          inf->slice     = MILLISECS(15);
    1.19 -        inf->latency   = 0;
    1.20 -        inf->deadl_abs = 0;
    1.21 -        inf->status     = EXTRA_AWARE | SEDF_ASLEEP;
    1.22      }
    1.23      else
    1.24      {
    1.25 -        /*other domains run in best effort mode*/
    1.26 +        /* Best-effort extratime only. */
    1.27          inf->period    = WEIGHT_PERIOD;
    1.28          inf->slice     = 0;
    1.29 -        inf->deadl_abs = 0;
    1.30 -        inf->latency   = 0;
    1.31 -        inf->status     = EXTRA_AWARE | SEDF_ASLEEP;
    1.32 -        inf->extraweight = 1;
    1.33      }
    1.34  
    1.35      inf->period_orig = inf->period; inf->slice_orig = inf->slice;
    1.36 @@ -609,7 +608,16 @@ static void desched_extra_dom(s_time_t n
    1.37          PRINT(3,"Domain %i.%i: Short_block_loss: %"PRIi64"\n", 
    1.38                inf->vcpu->domain->domain_id, inf->vcpu->vcpu_id,
    1.39                inf->short_block_lost_tot);
    1.40 +#if 0
    1.41 +        /*
    1.42 +         * KAF: If we don't exit short-blocking state at this point
    1.43 +         * domain0 can steal all CPU for up to 10 seconds before
    1.44 +         * scheduling settles down (when competing against another
    1.45 +         * CPU-bound domain). Doing this seems to make things behave
    1.46 +         * nicely. Noone gets starved by default.
    1.47 +         */
    1.48          if ( inf->short_block_lost_tot <= 0 )
    1.49 +#endif
    1.50          {
    1.51              PRINT(4,"Domain %i.%i compensated short block loss!\n",
    1.52                    inf->vcpu->domain->domain_id, inf->vcpu->vcpu_id);