From patchwork Thu Apr 11 10:45:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 10895727 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E5705186D for ; Thu, 11 Apr 2019 10:49:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D1B5F28997 for ; Thu, 11 Apr 2019 10:49:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C60D4289C0; Thu, 11 Apr 2019 10:49:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6808F28997 for ; Thu, 11 Apr 2019 10:49:51 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hEXFD-0005RN-S9; Thu, 11 Apr 2019 10:47:47 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hEXFC-0005RI-VS for xen-devel@lists.xenproject.org; Thu, 11 Apr 2019 10:47:47 +0000 X-Inumbo-ID: 3d239ed1-5c47-11e9-92d7-bc764e045a96 Received: from prv1-mh.provo.novell.com (unknown [137.65.248.33]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 3d239ed1-5c47-11e9-92d7-bc764e045a96; Thu, 11 Apr 2019 10:47:45 +0000 (UTC) Received: from INET-PRV1-MTA by prv1-mh.provo.novell.com with Novell_GroupWise; Thu, 11 Apr 2019 04:45:44 -0600 Message-Id: <5CAF1AD502000078002268CA@prv1-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 18.1.0 Date: Thu, 11 Apr 2019 04:45:41 -0600 From: "Jan Beulich" To: "xen-devel" Mime-Version: 1.0 Content-Disposition: inline Subject: [Xen-devel] [PATCH] timers: move back migrate_timers_from_cpu() invocation X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- a/xen/common/timer.c +++ b/xen/common/timer.c @@ -619,8 +619,6 @@ static void free_percpu_timers(unsigned { 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;