[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.faggi...@citrix.com> 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
Description: This is a digitally signed message part

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to