[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2 2/2] xen: credit1: avoid boosting vCPUs being "just" migrated
[Yes, replying to myself] On Fri, 2016-02-12 at 11:50 +0100, Dario Faggioli wrote: > On Fri, 2016-02-12 at 02:50 -0700, Jan Beulich wrote: > > > > > On 12.02.16 at 10:37, <dario.faggioli@xxxxxxxxxx> wrote: > > > @@ -787,6 +788,16 @@ _csched_cpu_pick(const struct scheduler > > > *ops, > > > struct vcpu *vc, bool_t commit) > > > Âstatic int > > > Âcsched_cpu_pick(const struct scheduler *ops, struct vcpu *vc) > > > Â{ > > > +ÂÂÂÂstruct csched_vcpu *svc = CSCHED_VCPU(vc); > > > + > > > +ÂÂÂÂ/* > > > +ÂÂÂÂÂ* We have been called by vcpu_migrate() (in schedule.c), as > > > part > > > +ÂÂÂÂÂ* of the process of seeing if vc can be migrated to another > > > pcpu. > > > +ÂÂÂÂÂ* We make a note about this in svc->flags so that later, in > > > +ÂÂÂÂÂ* csched_vcpu_wake() (still called from vcpu_migrate()) we > > > won't > > > +ÂÂÂÂÂ* get boosted, which we don't deserve as we are "only" > > > migrating. > > > +ÂÂÂÂÂ*/ > > > +ÂÂÂÂset_bit(CSCHED_FLAG_VCPU_MIGRATING, &svc->flags); > > > ÂÂÂÂÂreturn _csched_cpu_pick(ops, vc, 1); > > > Â} > > > > I think you either want __set_bit() here or ... > > > Yes, this is completely serialized by the vcpu's scheduler lock, so I > indeed want __set_bit(), sorry for the overlook. > Which is indeed the case, in the case of this svc->flags, but not for other cases when svc->flags is used, for manipulating the other two existing flags (see, for instance be6507509454adf3bb5a50b9406c88504e996d5a "credit1: Use atomic bit operations for the flags structure"). So what I want is really the opposite of what I said above: set_bit() is ok, and I need the atomic test_and_clear(). -ENEEDMORECOFFEEATMORNING Â:-/ Thanks again and Regards, 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 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |