[xen master] xen: ARM: suspend the tick (if in use) when going idle.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen master] xen: ARM: suspend the tick (if in use) when going idle.

patchbot
commit 05c52278a7c92bc753d9fe32017e4961012b9f23
Author:     Dario Faggioli <[hidden email]>
AuthorDate: Wed Aug 30 12:06:20 2017 +0100
Commit:     George Dunlap <[hidden email]>
CommitDate: Wed Aug 30 12:06:20 2017 +0100

    xen: ARM: suspend the tick (if in use) when going idle.
   
    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 <[hidden email]>
    Reviewed-by: Stefano Stabellini <[hidden email]>
    Reviewed-by: Tim Deegan <[hidden email]>
---
 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 ee0886e..6512f01 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();
@@ -58,15 +77,7 @@ void idle_loop(void)
          */
         else if ( !softirq_pending(cpu) && !scrub_free_pages() &&
                   !softirq_pending(cpu) )
-        {
-            local_irq_disable();
-            if ( cpu_is_haltable(cpu) )
-            {
-                dsb(sy);
-                wfi();
-            }
-            local_irq_enable();
-        }
+            do_idle();
 
         do_softirq();
         /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog