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

Re: [Xen-devel] [PATCH 2/5] xen: ARM: suspend the tick (if in use) when going idle.



On Thu, 27 Jul 2017, Dario Faggioli wrote:
> Since commit 964fae8ac ("cpuidle: suspend/resume scheduler
> tick timer during cpu idle state entry/exit"), if a scheduler
> has a periodic tick timer, we stop it when going idle.
> 
> This, however, is only true for x86. Make it true for ARM as
> well.
> 
> Signed-off-by: Dario Faggioli <dario.faggioli@xxxxxxxxxx>

Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>


> ---
> Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
> Cc: Julien Grall <julien.grall@xxxxxxx>
> ---
>  xen/arch/arm/domain.c |   29 ++++++++++++++++++++---------
>  1 file changed, 20 insertions(+), 9 deletions(-)
> 
> diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
> index 2dc8b0a..fce29cb 100644
> --- a/xen/arch/arm/domain.c
> +++ b/xen/arch/arm/domain.c
> @@ -39,6 +39,25 @@
>  
>  DEFINE_PER_CPU(struct vcpu *, curr_vcpu);
>  
> +static void do_idle(void)
> +{
> +    unsigned int cpu = smp_processor_id();
> +
> +    sched_tick_suspend();
> +    /* sched_tick_suspend() can raise TIMER_SOFTIRQ. Process it now. */
> +    process_pending_softirqs();
> +
> +    local_irq_disable();
> +    if ( cpu_is_haltable(cpu) )
> +    {
> +        dsb(sy);
> +        wfi();
> +    }
> +    local_irq_enable();
> +
> +    sched_tick_resume();
> +}
> +
>  void idle_loop(void)
>  {
>      unsigned int cpu = smp_processor_id();
> @@ -52,15 +71,7 @@ void idle_loop(void)
>          if ( unlikely(tasklet_work_to_do(cpu)) )
>              do_tasklet();
>          else
> -        {
> -            local_irq_disable();
> -            if ( cpu_is_haltable(cpu) )
> -            {
> -                dsb(sy);
> -                wfi();
> -            }
> -            local_irq_enable();
> -        }
> +            do_idle();
>  
>          do_softirq();
>          /*
> 

_______________________________________________
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®.