[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 Mon, 2017-03-27 at 14:23 +0100, George Dunlap wrote:
> On 17/03/17 18:19, Dario Faggioli wrote:
> > --- 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.
> 
Maybe:

domain_scheduler()
vcpu_scheduler()

or

dom_scheduler()
vcpu_scheduler()

I.e., basically getting rid of the 'get' part, which may misleadingly
hint at some kind of reference counting.

Or, also trading 'scheduler' for 'ops':

dom_ops()
vcpu_ops()

This is all I can come up with, my preference being
{dom,vcpu}_scheduler().

Dario
-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

Attachment: signature.asc
Description: This is a digitally signed message part

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