All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dario Faggioli <dario.faggioli@citrix.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Julien Grall <julien.grall@arm.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Jan Beulich <JBeulich@suse.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH] xen: idle_loop: either deal with tasklets or go idle
Date: Fri, 16 Jun 2017 22:06:24 +0200	[thread overview]
Message-ID: <1497643584.30417.9.camel@citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.10.1706161041140.17964@sstabellini-ThinkPad-X260>


[-- Attachment #1.1: Type: text/plain, Size: 2180 bytes --]

On Fri, 2017-06-16 at 10:41 -0700, Stefano Stabellini wrote:
> On Fri, 16 Jun 2017, Dario Faggioli wrote:
> > 
> > diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
> > index 76310ed..86cd612 100644
> > --- a/xen/arch/arm/domain.c
> > +++ b/xen/arch/arm/domain.c
> > @@ -41,20 +41,28 @@ DEFINE_PER_CPU(struct vcpu *, curr_vcpu);
> >  
> >  void idle_loop(void)
> >  {
> > +    unsigned int cpu = smp_processor_id();
> > +
> >      for ( ; ; )
> >      {
> > -        if ( cpu_is_offline(smp_processor_id()) )
> > +        if ( cpu_is_offline(cpu) )
> >              stop_cpu();
> >  
> > -        local_irq_disable();
> > -        if ( cpu_is_haltable(smp_processor_id()) )
> > +        /* Are we here for running vcpu context tasklets, or for
> > idling? */
> > +        if ( cpu_is_haltable(cpu) )
> >          {
> > -            dsb(sy);
> > -            wfi();
> > +            local_irq_disable();
> > +            /* We need to check again, with IRQ disabled */
> > +            if ( cpu_is_haltable(cpu) )
> > +            {
> > +                dsb(sy);
> > +                wfi();
> > +            }
> > +            local_irq_enable();
> >          }
> > -        local_irq_enable();
> > +        else
> > +            do_tasklet();
> >  
> > -        do_tasklet();
> >          do_softirq();
> 
> Are you sure you want to check that cpu_is_haltable twice? It doesn't
> make sense to me.
>
It's because of IRQ being disabled the first time.

But anyway, discard this patch. I'll go back to (a slightly modified
version of) the first one I sent, which defines a tasklet specific
helper function.

I'll send it on Monday.

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 #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

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

      reply	other threads:[~2017-06-16 20:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-14 16:53 [PATCH] xen: idle_loop: either deal with tasklets or go idle Dario Faggioli
2017-06-14 16:53 ` Dario Faggioli
2017-06-16  8:54   ` Jan Beulich
2017-06-16 10:44     ` Dario Faggioli
2017-06-16 11:47       ` Jan Beulich
2017-06-16 13:34         ` Dario Faggioli
2017-06-16 14:09           ` Jan Beulich
2017-06-16 17:41       ` Stefano Stabellini
2017-06-16 20:06         ` Dario Faggioli [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1497643584.30417.9.camel@citrix.com \
    --to=dario.faggioli@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=julien.grall@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.