Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp14472615ybl; Mon, 30 Dec 2019 10:43:07 -0800 (PST) X-Google-Smtp-Source: APXvYqwedW5231f+FsmoUhZTGIrtamfcKBpCFqGCtXLyRgsxPB1lC3hKVLoN+zdRF0lcxzRGVdxX X-Received: by 2002:aca:5083:: with SMTP id e125mr246280oib.96.1577731387633; Mon, 30 Dec 2019 10:43:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577731387; cv=none; d=google.com; s=arc-20160816; b=T4gI0ZnDbUg/Z6tVMxXdbeO7purBgXlUPn0ken/IrP2T4R75VRnYgjbxFv06BCXqqB TGxxUy1Md1yQjQeLQrGRQ5wbZ/m1CisRsGTJ9PGTJ+IO31a+etiD6u5i/PaINdi4Q8AH SHAO4niSzaTs9r8Ps6251h2b9Rbry6o/r1q5u4/Rvn9yDOP/tFE27QNOUwtPKv3vdk8G T/zUrnvzra6ssVvhk2H/17Jj3DXAGAGUuqUH410ag33QDjj6R+WnfokIBtv1BdiCxXk6 e9lfE0XXV6EyvOvN6Yxv2OyYtGPUhlv9FNC4qH7s43y2Uk0opgd8mw2STTTcPWAvHJFK uZHw== 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 :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=Th5BK9eXcLwlb5OVtyy8ytMphqOco/c8g2Q9CbXWTpU=; b=0vlN71f3ZDfVHcWOs/r/9jLxXqkJ2c4gddfel9x8ylvvhsDt4B+2zdxKTklSUVAepY a+El5sTaGUfXAzDmp7Wvfpb0QzUrEbHqic47opPyqa5+tZkdpJMvrfkw9GW/D7hCge32 f5zLVmkbCraR07tOz5eN/c7aR8ML6E8RQ5kXkAHLqLUrCsfUAVDsOY0HGEjDcZVfps8D 3Ye14QXMzB5FnDguHGMLalk5Dp1MjF04zGnlHQ4neTnNyY6LxXel6uqDb1d8xIRMscnW bWlpnL5eP/tdYzcn1qo/QNjf+SbwtFStX01g5ui2vHxhhostgr5KLnMAc4yfWnqlFEuL Er6Q== ARC-Authentication-Results: i=1; mx.google.com; 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 s16si19128203oih.4.2019.12.30.10.42.56; Mon, 30 Dec 2019 10:43:07 -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; 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 S1727597AbfL3SmU (ORCPT + 99 others); Mon, 30 Dec 2019 13:42:20 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:48083 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727532AbfL3SmT (ORCPT ); Mon, 30 Dec 2019 13:42:19 -0500 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1ilzzO-0006Ji-I1; Mon, 30 Dec 2019 19:42:02 +0100 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 4F6851C0450; Mon, 30 Dec 2019 19:42:01 +0100 (CET) Date: Mon, 30 Dec 2019 18:42:01 -0000 From: "tip-bot2 for Qian Cai" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/urgent] x86/resctrl: Fix an imbalance in domain_remove_cpu() Cc: 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" , LKML In-Reply-To: <20191211033042.2188-1-cai@lca.pw> References: <20191211033042.2188-1-cai@lca.pw> MIME-Version: 1.0 Message-ID: <157773132107.30329.13477468873808479241.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/urgent branch of tip: Commit-ID: e278af89f1ba0a9ef20947db6afc2c9afa37e85b Gitweb: https://git.kernel.org/tip/e278af89f1ba0a9ef20947db6afc2c9afa37e85b Author: Qian Cai AuthorDate: Tue, 10 Dec 2019 22:30:42 -05:00 Committer: Borislav Petkov CommitterDate: Mon, 30 Dec 2019 19:25:59 +01:00 x86/resctrl: Fix an imbalance in domain_remove_cpu() 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 --- arch/x86/kernel/cpu/resctrl/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c index 03eb90d..89049b3 100644 --- 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, struct rdt_resource *r) 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)) { /*