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

Re: [Xen-devel] [PATCH 01/19] xen: sched: leave CPUs doing tasklet work alone.



On Mon, 2016-06-20 at 01:48 -0600, Jan Beulich wrote:
> > > > On 18.06.16 at 01:11, <dario.faggioli@xxxxxxxxxx> wrote:
> > --- a/xen/common/sched_credit.c
> > +++ b/xen/common/sched_credit.c
> > @@ -1819,24 +1819,24 @@ csched_schedule(
> >      else
> >          snext = csched_load_balance(prv, cpu, snext,
> > &ret.migrated);
> >  
> > + out:
> >      /*
> >       * Update idlers mask if necessary. When we're idling, other
> > CPUs
> >       * will tickle us when they get extra work.
> >       */
> > -    if ( snext->pri == CSCHED_PRI_IDLE )
> > +    if ( tasklet_work_scheduled || snext->pri != CSCHED_PRI_IDLE )
> >      {
> > -        if ( !cpumask_test_cpu(cpu, prv->idlers) )
> > -            cpumask_set_cpu(cpu, prv->idlers);
> > +        if ( cpumask_test_cpu(cpu, prv->idlers) )
> > +            cpumask_clear_cpu(cpu, prv->idlers);
> >      }
> > -    else if ( cpumask_test_cpu(cpu, prv->idlers) )
> > +    else if ( !cpumask_test_cpu(cpu, prv->idlers) )
> >      {
> > -        cpumask_clear_cpu(cpu, prv->idlers);
> > +        cpumask_set_cpu(cpu, prv->idlers);
> >      }
> Is there a reason for this extra code churn? It would seem to me
> that the change could be just the "out" label movement and
> adjustment to the first if:
> 
>    if ( !tasklet_work_scheduled && snext->pri == CSCHED_PRI_IDLE )
> 
> Am I overlooking something?
> 
No, you are not. It indeed can be done as you suggest, and it's better,
so I'll go for it.

Thanks 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@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®.