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

Re: [Xen-devel] [PATCH v2 2/2] xen: sched: improve robustness (and rename) DOM2OP()



On 17/03/17 18:19, 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>
> ---
> 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.
> ---
>  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..fdb8ff4 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_get_scheduler(const struct domain *d)

Hmm -- I agree that VCPU2OP is probably not the right name, but I'm not
a fan of the new name either; and I don't have an option I like better yet.

With your permission I'll check in the first patch and come back to this.

 -George


_______________________________________________
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®.