]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
timers: move back migrate_timers_from_cpu() invocation
authorJan Beulich <JBeulich@suse.com>
Thu, 11 Apr 2019 10:45:41 +0000 (04:45 -0600)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 15 Apr 2019 16:51:30 +0000 (17:51 +0100)
Commit 597fbb8be6 ("xen/timers: Fix memory leak with cpu unplug/plug")
went a little too far: Migrating timers away from a CPU being offlined
needs to heppen independent of whether it get parked or fully offlined.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
xen/common/timer.c

index f265a362dd6887e162cab6421088f6c79b12ad9f..9ee500b3a7f99e12b6fe45ed1057f45f8a5e7b53 100644 (file)
@@ -619,8 +619,6 @@ static void free_percpu_timers(unsigned int cpu)
 {
     struct timers *ts = &per_cpu(timers, cpu);
 
-    migrate_timers_from_cpu(cpu);
-
     ASSERT(heap_metadata(ts->heap)->size == 0);
     if ( heap_metadata(ts->heap)->limit )
     {
@@ -648,6 +646,8 @@ static int cpu_callback(
     case CPU_UP_CANCELED:
     case CPU_DEAD:
     case CPU_RESUME_FAILED:
+        migrate_timers_from_cpu(cpu);
+
         if ( !park_offline_cpus && system_state != SYS_STATE_suspend )
             free_percpu_timers(cpu);
         break;