ia64/xen-unstable

changeset 8168:6b18f820f6a7

Prevent BVT scheduler to be set with a too low ctx_allow by applying
a 10 microsecs low limit to the user parameter.

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
author vhanquez@kneesa.uk.xensource.com
date Thu Dec 01 13:13:15 2005 +0000 (2005-12-01)
parents f5b119533cc8
children ca236a81729d
files xen/common/sched_bvt.c
line diff
     1.1 --- a/xen/common/sched_bvt.c	Thu Dec 01 15:22:22 2005 +0100
     1.2 +++ b/xen/common/sched_bvt.c	Thu Dec 01 13:13:15 2005 +0000
     1.3 @@ -67,6 +67,7 @@ struct bvt_cpu_info
     1.4  #define MCU            (s32)MICROSECS(100)    /* Minimum unit */
     1.5  #define MCU_ADVANCE    10                     /* default weight */
     1.6  #define TIME_SLOP      (s32)MICROSECS(50)     /* allow time to slip a bit */
     1.7 +#define CTX_MIN        (s32)MICROSECS(10)     /* Low limit for ctx_allow */
     1.8  static s32 ctx_allow = (s32)MILLISECS(5);     /* context switch allowance */
     1.9  
    1.10  static inline void __add_to_runqueue_head(struct vcpu *d)
    1.11 @@ -297,7 +298,11 @@ static int bvt_ctl(struct sched_ctl_cmd 
    1.12      if ( cmd->direction == SCHED_INFO_PUT )
    1.13          ctx_allow = params->ctx_allow;
    1.14      else
    1.15 +    {
    1.16 +        if ( ctx_allow < CTX_MIN )
    1.17 +            ctx_allow = CTX_MIN;
    1.18          params->ctx_allow = ctx_allow;
    1.19 +    }
    1.20      
    1.21      return 0;
    1.22  }