2014-09-15 18:07 GMT-04:00 Ian Campbell <ian.campbell@citrix.com>:
On Sun, 2014-09-14 at 17:37 -0400, Meng Xu wrote:
> Add libxl functions to set/get domain's parameters for rtds scheduler
> Note: VCPU's information (period, budget) is in microsecond (us).
>
> Signed-off-by: Meng Xu <mengxu@cis.upenn.edu>
> Signed-off-by: Sisu Xi <xisisu@gmail.com>

Mostly looks good.

The main thing which is missing is a #define LIBXL_HAVE_XXX in libxl to
advertise this new feature (there are a bunch of existing examples which
you can copy).

​Will add it inside libxl.h​

 

> +    if (scinfo->period != LIBXL_DOMAIN_SCHED_PARAM_PERIOD_DEFAULT) {
> +        if (scinfo->period < 1) {
> +            LOG(ERROR, "VCPU period is not set or out of range, "
> +                       "valid values are larger than 1");

There's no upper limit? Likewise for the budget further down?

​Yes. In the previous version, I used the UINT_MAX as the upper bound. Because period is int, so it will never reach the UINT_MAX. Even if I change the UINT_MAX to INT_MAX as the upper bound, period may still not able to reach it. So George suggests to remove the upper bound check if it uses the range of type of period. 

Since period is int, the largest period we support should be 2^31-1us = 0.5965 hours. That's why we don't have the upper bound check. Of course, I can add the upper bound as INT_MAX (2^31-1) and reports error when users try to assign a large value to period and budget.

What do you think?

Thanks,

Meng


--


-----------
Meng Xu
PhD Student in Computer and Information Science
University of Pennsylvania