Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4820215ybl; Wed, 22 Jan 2020 05:22:37 -0800 (PST) X-Google-Smtp-Source: APXvYqwRcpD5XsaGTG2WfjzLZnO0QlfEhg0jkIC2V7/y0qVvVBwCiP3fxp4MO11yLUZXdexJ1aFs X-Received: by 2002:aca:f242:: with SMTP id q63mr6872500oih.72.1579699356831; Wed, 22 Jan 2020 05:22:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579699356; cv=none; d=google.com; s=arc-20160816; b=WNiRa0WgcQ0dLBM2x8S5Iw2u7jctlb5nAeOfh7xz796NtOoOKwerQnTIhfkPZwfc24 mSUFeaPXPAV4RdoQya/2rOsh/qR2+djmv5wHM+SmNmYBsBsllnvdFBhP/fhS1Xw4PVw/ kZiMVM2SEJneMYv1jgemr0MB4mgGWpYxqi0ukLflGW3JpoPZJhcTr64i2XIxxrUVWlU2 Rfi0cGbi8eVOPfJhaZzijASajidzrZL4e+/pFhYuv5ZbCSSSXuS97fWzV3pbAtS1ITja tJpNEEXLiSBqAKXEry1+wY4yfkzstT1r8R1x5nelF3D8V3YlFJEdqSHbbGJuvd7eVre2 UlNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=SqoDXWMoLLp6l2q58iMlets1MxcQH8vuPvC04Yy5lvU=; b=gqglcc+j8bt5Jd+mpfXj8c8J1PVyyLKj4SkQs5AnNMUELI1k9/XOpeAjHHANl6r7qO 8iqI0h/Up8WPAYZvBEanDDVh/fJijsaPWW/WVhBGA4B8oq5kcrUUKOToMQFQuhlI/mC6 09KL1IAa6k0wSi2v6o5ac3dd8f0xO4lyJITW5ANobTn60nn/vaNW45LpbaGFAD+ZI3/3 6XILY4UHEinluSn7WjeEFXhZR9JHvnINFKBym+XWsA4FFFKn9j9/kpui3RvtJSkwvUZx BgLx0QORbRIibvHrxQ3s5afN21WCa/k0sP1WYg1tWQU7VuZItKGLlVgNwIT+TDVzkABg xMGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=i5Om6LrI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i17si12221730otr.14.2020.01.22.05.22.24; Wed, 22 Jan 2020 05:22:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=i5Om6LrI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729740AbgAVNTh (ORCPT + 99 others); Wed, 22 Jan 2020 08:19:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:35512 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727816AbgAVNTf (ORCPT ); Wed, 22 Jan 2020 08:19:35 -0500 Received: from localhost (unknown [84.241.205.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 947BA2071E; Wed, 22 Jan 2020 13:19:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579699174; bh=5o1iS8b4oMfFF/foWqXLudFQPQzd0UBvLxrLI1zM6qc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i5Om6LrIafW4pybBgUmn4ARnG99OQ/xcZnc0vMI16cfE8Y2QTSHbXaxZdcSD+JkQE K2r4VJgbZO/unNqiVdo9F5S8XZ3kiXoVR2qQVOmF54/bP0m+qOhWc92nyG85cfguj6 yjdp9CK89E64HVFzBkEtyegZ4pKpnMTKMQ4HELLU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qian Cai , Borislav Petkov , Reinette Chatre , Fenghua Yu , "H. Peter Anvin" , Ingo Molnar , john.stultz@linaro.org, sboyd@kernel.org, Thomas Gleixner , tj@kernel.org, Tony Luck , Vikas Shivappa , x86-ml Subject: [PATCH 5.4 062/222] x86/resctrl: Fix an imbalance in domain_remove_cpu() Date: Wed, 22 Jan 2020 10:27:28 +0100 Message-Id: <20200122092838.159130044@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092833.339495161@linuxfoundation.org> References: <20200122092833.339495161@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Qian Cai commit e278af89f1ba0a9ef20947db6afc2c9afa37e85b upstream. A system that supports resource monitoring may have multiple resources while not all of these resources are capable of monitoring. Monitoring related state is initialized only for resources that are capable of monitoring and correspondingly this state should subsequently only be removed from these resources that are capable of monitoring. domain_add_cpu() calls domain_setup_mon_state() only when r->mon_capable is true where it will initialize d->mbm_over. However, domain_remove_cpu() calls cancel_delayed_work(&d->mbm_over) without checking r->mon_capable resulting in an attempt to cancel d->mbm_over on all resources, even those that never initialized d->mbm_over because they are not capable of monitoring. Hence, it triggers a debugobjects warning when offlining CPUs because those timer debugobjects are never initialized: ODEBUG: assert_init not available (active state 0) object type: timer_list hint: 0x0 WARNING: CPU: 143 PID: 789 at lib/debugobjects.c:484 debug_print_object Hardware name: HP Synergy 680 Gen9/Synergy 680 Gen9 Compute Module, BIOS I40 05/23/2018 RIP: 0010:debug_print_object Call Trace: debug_object_assert_init del_timer try_to_grab_pending cancel_delayed_work resctrl_offline_cpu cpuhp_invoke_callback cpuhp_thread_fun smpboot_thread_fn kthread ret_from_fork Fixes: e33026831bdb ("x86/intel_rdt/mbm: Handle counter overflow") Signed-off-by: Qian Cai Signed-off-by: Borislav Petkov Acked-by: Reinette Chatre Cc: Fenghua Yu Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: john.stultz@linaro.org Cc: sboyd@kernel.org Cc: Cc: Thomas Gleixner Cc: tj@kernel.org Cc: Tony Luck Cc: Vikas Shivappa Cc: x86-ml Link: https://lkml.kernel.org/r/20191211033042.2188-1-cai@lca.pw Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/cpu/resctrl/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -618,7 +618,7 @@ static void domain_remove_cpu(int cpu, s if (static_branch_unlikely(&rdt_mon_enable_key)) rmdir_mondata_subdir_allrdtgrp(r, d->id); list_del(&d->list); - if (is_mbm_enabled()) + if (r->mon_capable && is_mbm_enabled()) cancel_delayed_work(&d->mbm_over); if (is_llc_occupancy_enabled() && has_busy_rmid(r, d)) { /*