[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH RFC v1 2/4] xl for rt scheduler

Hi Wei,

First, thank you very much for your comments!Â

> diff --git a/tools/libxl/xl.h b/tools/libxl/xl.h
> index 10a2e66..51b634a 100644
> --- a/tools/libxl/xl.h
> +++ b/tools/libxl/xl.h
> @@ -67,6 +67,7 @@ int main_memset(int argc, char **argv);
> Âint main_sched_credit(int argc, char **argv);
> Âint main_sched_credit2(int argc, char **argv);
> Âint main_sched_sedf(int argc, char **argv);
> +int main_sched_rt(int argc, char **argv);
> Âint main_domid(int argc, char **argv);
> Âint main_domname(int argc, char **argv);
> Âint main_rename(int argc, char **argv);
> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> index 68df548..c043f88 100644
> --- a/tools/libxl/xl_cmdimpl.c
> +++ b/tools/libxl/xl_cmdimpl.c
> @@ -4947,6 +4947,7 @@ int main_sharing(int argc, char **argv)
> Â Â Âreturn 0;
> Â}
> +

Stray blank line.

âI will delete the blank line.

> Âstatic int sched_domain_get(libxl_scheduler sched, int domid,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âlibxl_domain_sched_params *scinfo)
> Â{
> @@ -5098,6 +5099,52 @@ static int sched_sedf_domain_output(
> Â Â Âreturn 0;
> Â}
> +
> +static int sched_rt_domain_output(
> + Â Âint domid)
> +{
> + Â Âchar *domname;
> + Â Âlibxl_domain_sched_params scinfo;
> + Â Âint rc, i;
> +
> + Â Âif (domid < 0) {
> + Â Â Â Âprintf("%-33s %4s %4s %6s %6s\n", "Name", "ID", "VCPU", "Period", "Budget");
> + Â Â Â Âreturn 0;
> + Â Â}
> +

Just print the header and nothing more?

âWe just print out the header here. This function will call âsched_domain_get(LIBXL_SCHEDULER_RT, domid, &scinfo) and print out the VCPUs parameters of each domain in the calling function. â


> + Â Âlibxl_domain_sched_params_init(&scinfo);
> + Â Ârc = sched_domain_get(LIBXL_SCHEDULER_RT, domid, &scinfo);
> + Â Âif (rc)
> + Â Â Â Âreturn rc;
> +

This is violating libxl type paradigm. See libxl.h.

Â263 Â* libxl types
Â264 Â*
Â265 Â* Most libxl types are defined by the libxl IDL (see
Â266 Â* libxl_types.idl). The library provides a common set of methods for
Â267 Â* initialising and freeing these types.
Â268 Â*
Â269 Â* IDL-generated libxl types should be used as follows: the user must
Â270 Â* always call the "init" function before using a type, even if the
Â271 Â* variable is simply being passed by reference as an out parameter
Â272 Â* to a libxl function. ÂThe user must always calls "dispose" exactly
Â273 Â* once afterwards, to clean up, regardless of whether operations on
Â274 Â* this object succeeded or failed. ÂSee the xl code for examples.

And you should check other places that use libxl types as well.

âThank you very much for pasting the rules here! I really appreciate it. However, I didn't quite get why it violate the libxl type paradigm and how I should correct it. (Sorry. :-()â

We actually followed the way credit scheduler does inÂmain_sched_credit(int argc, char **argv)

    } else { /* set credit scheduler paramaters */
      libxl_domain_sched_params scinfo;
      scinfo.sched = LIBXL_SCHEDULER_CREDIT;
      if (opt_w)
        scinfo.weight = weight;
      if (opt_c)
        scinfo.cap = cap;
      rc = sched_domain_set(domid, &scinfo);

Could you help let me know how I should modify it? I will check the rest to modify when I know how to do it.Â

Thank you very much!




Meng Xu
PhD Student in Computer and Information Science
University of Pennsylvania
Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.