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

Re: [Xen-devel] [PATCH 3/3] tools: sched: add support for 'null' scheduler



On Fri, 17 Mar 2017, Dario Faggioli wrote:
> It being very very basic, also means this scheduler does
> not need much support at the tools level (for now).
> 
> Basically, just the definition of the symbol of the
> scheduler itself and a couple of stubs.
> 
> Signed-off-by: Dario Faggioli <dario.faggioli@xxxxxxxxxx>

Acked-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>


> ---
> Cc: Wei Liu <wei.liu2@xxxxxxxxxx>
> Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
> Cc: George Dunlap <george.dunlap@xxxxxxxxxx>
> Cc: Stefano Stabellini <stefano@xxxxxxxxxxx>
> Cc: Julien Grall <julien.grall@xxxxxxx>
> ---
>  tools/libxl/libxl.h         |    6 ++++++
>  tools/libxl/libxl_sched.c   |   24 ++++++++++++++++++++++++
>  tools/libxl/libxl_types.idl |    1 +
>  3 files changed, 31 insertions(+)
> 
> diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
> index 4c60e8f..5adac2d 100644
> --- a/tools/libxl/libxl.h
> +++ b/tools/libxl/libxl.h
> @@ -210,6 +210,12 @@
>  #define LIBXL_HAVE_SCHED_RTDS 1
>  
>  /*
> + * LIBXL_HAVE_SCHED_NULL indicates that the 'null' static scheduler
> + * is available.
> + */
> +#define LIBXL_HAVE_SCHED_NULL 1
> +
> +/*
>   * libxl_domain_build_info has u.hvm.viridian_enable and _disable bitmaps
>   * of the specified width.
>   */
> diff --git a/tools/libxl/libxl_sched.c b/tools/libxl/libxl_sched.c
> index 84d3837..d44fbe1 100644
> --- a/tools/libxl/libxl_sched.c
> +++ b/tools/libxl/libxl_sched.c
> @@ -178,6 +178,20 @@ static int sched_arinc653_domain_set(libxl__gc *gc, 
> uint32_t domid,
>      return 0;
>  }
>  
> +static int sched_null_domain_set(libxl__gc *gc, uint32_t domid,
> +                                 const libxl_domain_sched_params *scinfo)
> +{
> +    /* The null scheduler doesn't take any domain-specific parameters. */
> +    return 0;
> +}
> +
> +static int sched_null_domain_get(libxl__gc *gc, uint32_t domid,
> +                               libxl_domain_sched_params *scinfo)
> +{
> +    /* The null scheduler doesn't have any domain-specific parameters. */
> +    return ERROR_INVAL;
> +}
> +
>  static int sched_credit_domain_get(libxl__gc *gc, uint32_t domid,
>                                     libxl_domain_sched_params *scinfo)
>  {
> @@ -730,6 +744,9 @@ int libxl_domain_sched_params_set(libxl_ctx *ctx, 
> uint32_t domid,
>      case LIBXL_SCHEDULER_RTDS:
>          ret=sched_rtds_domain_set(gc, domid, scinfo);
>          break;
> +    case LIBXL_SCHEDULER_NULL:
> +        ret=sched_null_domain_set(gc, domid, scinfo);
> +        break;
>      default:
>          LOGD(ERROR, domid, "Unknown scheduler");
>          ret=ERROR_INVAL;
> @@ -758,6 +775,7 @@ int libxl_vcpu_sched_params_set(libxl_ctx *ctx, uint32_t 
> domid,
>      case LIBXL_SCHEDULER_CREDIT:
>      case LIBXL_SCHEDULER_CREDIT2:
>      case LIBXL_SCHEDULER_ARINC653:
> +    case LIBXL_SCHEDULER_NULL:
>          LOGD(ERROR, domid, "per-VCPU parameter setting not supported for 
> this scheduler");
>          rc = ERROR_INVAL;
>          break;
> @@ -792,6 +810,7 @@ int libxl_vcpu_sched_params_set_all(libxl_ctx *ctx, 
> uint32_t domid,
>      case LIBXL_SCHEDULER_CREDIT:
>      case LIBXL_SCHEDULER_CREDIT2:
>      case LIBXL_SCHEDULER_ARINC653:
> +    case LIBXL_SCHEDULER_NULL:
>          LOGD(ERROR, domid, "per-VCPU parameter setting not supported for 
> this scheduler");
>          rc = ERROR_INVAL;
>          break;
> @@ -832,6 +851,9 @@ int libxl_domain_sched_params_get(libxl_ctx *ctx, 
> uint32_t domid,
>      case LIBXL_SCHEDULER_RTDS:
>          ret=sched_rtds_domain_get(gc, domid, scinfo);
>          break;
> +    case LIBXL_SCHEDULER_NULL:
> +        ret=sched_null_domain_get(gc, domid, scinfo);
> +        break;
>      default:
>          LOGD(ERROR, domid, "Unknown scheduler");
>          ret=ERROR_INVAL;
> @@ -858,6 +880,7 @@ int libxl_vcpu_sched_params_get(libxl_ctx *ctx, uint32_t 
> domid,
>      case LIBXL_SCHEDULER_CREDIT:
>      case LIBXL_SCHEDULER_CREDIT2:
>      case LIBXL_SCHEDULER_ARINC653:
> +    case LIBXL_SCHEDULER_NULL:
>          LOGD(ERROR, domid, "per-VCPU parameter getting not supported for 
> this scheduler");
>          rc = ERROR_INVAL;
>          break;
> @@ -890,6 +913,7 @@ int libxl_vcpu_sched_params_get_all(libxl_ctx *ctx, 
> uint32_t domid,
>      case LIBXL_SCHEDULER_CREDIT:
>      case LIBXL_SCHEDULER_CREDIT2:
>      case LIBXL_SCHEDULER_ARINC653:
> +    case LIBXL_SCHEDULER_NULL:
>          LOGD(ERROR, domid, "per-VCPU parameter getting not supported for 
> this scheduler");
>          rc = ERROR_INVAL;
>          break;
> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
> index 6d28dea..ce733c4 100644
> --- a/tools/libxl/libxl_types.idl
> +++ b/tools/libxl/libxl_types.idl
> @@ -191,6 +191,7 @@ libxl_scheduler = Enumeration("scheduler", [
>      (6, "credit2"),
>      (7, "arinc653"),
>      (8, "rtds"),
> +    (9, "null"),
>      ])
>  
>  # Consistent with SHUTDOWN_* in sched.h (apart from UNKNOWN)
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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