diff -r 116e2691c071 xen/common/sched_credit.c --- a/xen/common/sched_credit.c Thu Jan 22 13:16:49 2009 +0900 +++ b/xen/common/sched_credit.c Thu Jan 22 13:21:28 2009 +0900 @@ -47,6 +47,7 @@ (CSCHED_CREDITS_PER_TICK * CSCHED_TICKS_PER_TSLICE) #define CSCHED_CREDITS_PER_ACCT \ (CSCHED_CREDITS_PER_TICK * CSCHED_TICKS_PER_ACCT) +#define CSCHED_MSECS_PER_BOOST_TSLICE 2 /* @@ -245,6 +246,7 @@ struct csched_private { uint16_t total_percent; int credit_balance; uint32_t runq_sort; + s_time_t boost_tslice; CSCHED_STATS_DEFINE() }; @@ -253,6 +255,10 @@ struct csched_private { * Global variables */ static struct csched_private csched_priv; + +/* opt_credit_tslice: time slice for BOOST priority */ +static unsigned int opt_credit_tslice = CSCHED_MSECS_PER_BOOST_TSLICE; +integer_param("credit_tslice", opt_credit_tslice); static void csched_tick(void *_cpu); @@ -1327,7 +1333,17 @@ csched_schedule(s_time_t now) /* * Return task to run next... */ - ret.time = MILLISECS(CSCHED_MSECS_PER_TSLICE); + if ( snext->pri == CSCHED_PRI_TS_BOOST ) + { + struct csched_vcpu * const svc = __runq_elem(runq->next); + + if ( svc->pri == CSCHED_PRI_TS_BOOST ) + ret.time = csched_priv.boost_tslice; + else + ret.time = MILLISECS(CSCHED_MSECS_PER_TICK); + } + else + ret.time = MILLISECS(CSCHED_MSECS_PER_TSLICE); ret.task = snext->vcpu; spc->start_time = now; @@ -1489,6 +1505,7 @@ csched_init(void) csched_priv.runq_sort = 0U; csched_priv.percent = 0; csched_priv.total_percent = 0; + csched_priv.boost_tslice = MILLISECS(opt_credit_tslice); CSCHED_STATS_RESET(); }