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

Re: [Xen-devel] [PATCH 3 of 8] xen: let the (credit) scheduler know about `node affinity`



On Tue, 2012-10-09 at 11:53 +0200, Juergen Gross wrote: 
> > diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
> > --- a/xen/common/sched_credit.c
> > +++ b/xen/common/sched_credit.c
> ...
> >   static int
> >   _csched_cpu_pick(const struct scheduler *ops, struct vcpu *vc, bool_t 
> > commit)
> >   {
> > -    cpumask_t cpus;
> > +    cpumask_t cpus, start_cpus;
> >       cpumask_t idlers;
> >       cpumask_t *online;
> > +    struct csched_dom *sdom = CSCHED_DOM(vc->domain);
> >       struct csched_pcpu *spc = NULL;
> >       int cpu;
> >
> >       /*
> > -     * Pick from online CPUs in VCPU's affinity mask, giving a
> > -     * preference to its current processor if it's in there.
> > +     * Pick an online CPU from the&&  of vcpu-affinity and node-affinity
> > +     * masks (if not empty, in which case only the vcpu-affinity mask is
> > +     * used). Also, try to give a preference to its current processor if
> > +     * it's in there.
> >        */
> >       online = cpupool_scheduler_cpumask(vc->domain->cpupool);
> >       cpumask_and(&cpus, online, vc->cpu_affinity);
> > -    cpu = cpumask_test_cpu(vc->processor,&cpus)
> > +    cpumask_and(&start_cpus,&cpus, sdom->node_affinity_cpumask);
> > +    if ( unlikely(cpumask_empty(&start_cpus)) )
> > +        cpumask_copy(&start_cpus,&cpus);
> > +    cpu = cpumask_test_cpu(vc->processor,&start_cpus)
> >               ? vc->processor
> > -            : cpumask_cycle(vc->processor,&cpus);
> > +            : cpumask_cycle(vc->processor,&start_cpus);
> >       ASSERT( !cpumask_empty(&cpus)&&  cpumask_test_cpu(cpu,&cpus) );
> 
> Shouldn't the ASSERT be changed to start_cpus, too?
> 
Well, it seems it definitely should, and I seem to have missed that! 

Thanks a lot,
Dario

-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/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
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.