|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2 1/5] xen: sched: improve robustness (and rename) DOM2OP()
On 07/04/17 01:33, Dario Faggioli wrote:
> Clarify and enforce (with ASSERTs) when the function
> is called on the idle domain, and explain in comments
> what it means and when it is ok to do so.
>
> While there, change the name of the function to a more
> self-explanatory one, and do the same to VCPU2OP.
>
> Signed-off-by: Dario Faggioli <dario.faggioli@xxxxxxxxxx>
Acked-by: George Dunlap <george.dunlap@xxxxxxxxxx>
With one nit...
> ---
> Cc: George Dunlap <george.dunlap@xxxxxxxxxx>
> Cc: Juergen Gross <jgross@xxxxxxxx>
> Cc: Jan Beulich <jbeulich@xxxxxxxx>
> ---
> Changes from v1:
> - new patch;
> - renamed VCPU2OP, as suggested during v1's review of patch 1.
>
> Changes from v1 of the null scheduler series:
> - renamed the helpers to dom_scheduler() and vcpu_scheduler().
> ---
> xen/common/schedule.c | 56
> ++++++++++++++++++++++++++++++++-----------------
> 1 file changed, 37 insertions(+), 19 deletions(-)
>
> diff --git a/xen/common/schedule.c b/xen/common/schedule.c
> index d344b7c..d67227f 100644
> --- a/xen/common/schedule.c
> +++ b/xen/common/schedule.c
> @@ -77,8 +77,25 @@ static struct scheduler __read_mostly ops;
> (( (opsptr)->fn != NULL ) ? (opsptr)->fn(opsptr, ##__VA_ARGS__ ) \
> : (typeof((opsptr)->fn(opsptr, ##__VA_ARGS__)))0 )
>
> -#define DOM2OP(_d) (((_d)->cpupool == NULL) ? &ops :
> ((_d)->cpupool->sched))
> -static inline struct scheduler *VCPU2OP(const struct vcpu *v)
> +static inline struct scheduler *dom_scheduler(const struct domain *d)
> +{
> + if ( likely(d->cpupool != NULL) )
> + return d->cpupool->sched;
> +
> + /*
> + * If d->cpupool is NULL, this is the idle domain. This is special
> + * because the idle domain does not really bolong to any cpupool, and,
*belong
I can fix this up on check-in if need be.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |