From 1aec95350ac8261cba516371710d4d837c26f6a0 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Thu, 11 Apr 2019 04:45:41 -0600 Subject: [PATCH] timers: move back migrate_timers_from_cpu() invocation 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 --- xen/common/timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/common/timer.c b/xen/common/timer.c index f265a362dd..9ee500b3a7 100644 --- a/xen/common/timer.c +++ b/xen/common/timer.c @@ -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; -- 2.39.5