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

Re: [PATCH v1 05/19] xen/sysctl: wrap around XEN_SYSCTL_sched_id



On Wed, 12 Mar 2025, Penny Zheng wrote:
> The following function shall be wrapped:
> - scheduler_id
> 
> Signed-off-by: Penny Zheng <Penny.Zheng@xxxxxxx>

Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>


> ---
>  xen/common/sched/core.c | 2 ++
>  xen/include/xen/sched.h | 7 +++++++
>  2 files changed, 9 insertions(+)
> 
> diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
> index d6296d99fd..ea452d8b3e 100644
> --- a/xen/common/sched/core.c
> +++ b/xen/common/sched/core.c
> @@ -2052,11 +2052,13 @@ long do_set_timer_op(s_time_t timeout)
>      return 0;
>  }
>  
> +#ifdef CONFIG_SYSCTL
>  /* scheduler_id - fetch ID of current scheduler */
>  int scheduler_id(void)
>  {
>      return operations.sched_id;
>  }
> +#endif
>  
>  /* Adjust scheduling parameter for a given domain. */
>  long sched_adjust(struct domain *d, struct xen_domctl_scheduler_op *op)
> diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
> index 559d201e0c..9bdeb85aa4 100644
> --- a/xen/include/xen/sched.h
> +++ b/xen/include/xen/sched.h
> @@ -849,7 +849,14 @@ int  sched_init_domain(struct domain *d, unsigned int 
> poolid);
>  void sched_destroy_domain(struct domain *d);
>  long sched_adjust(struct domain *d, struct xen_domctl_scheduler_op *op);
>  long sched_adjust_global(struct xen_sysctl_scheduler_op *op);
> +#ifdef CONFIG_SYSCTL
>  int  scheduler_id(void);
> +#else
> +static inline int scheduler_id(void)
> +{
> +    return -EOPNOTSUPP;
> +}
> +#endif
>  
>  /*
>   * sched_get_id_by_name - retrieves a scheduler id given a scheduler name
> -- 
> 2.34.1
> 



 


Rackspace

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