From nobody Fri Oct 3 20:55:19 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 814F22DE6FB; Mon, 25 Aug 2025 10:24:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756117474; cv=none; b=hl6ZFn17hFNYJGBpyMaF6HWMY7PHweuJR2+fFi2WM5nFAfQkXUlwKTkai3KuiFG8CMscPKzHaWQ3cJQWQf1dc3NcguTSpTNyBXwQMvJV8oZOVW1Xy7qnPACeDwlsqg/MtiLp7/3bBrBs97Syc3lHp5/q3erIHrWruF9hxHxw06g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756117474; c=relaxed/simple; bh=lZoXSB6cJujo9MdoD5RqAmWEzXCE7BD+NiR+DFYuGfo=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=lg9VGvzYzeo92W29uHc7gz16/fmgHiwieKjLbM2oSI+TImkg1aNX1veGeC9cZ7Vl9am9s9dmxt1RJI9Ikj37Qkaq/qnCWpTiFVI1XNwcfzvJWERad3e2VJqNtZyvfC/hhuun168At2bw2TpHqwVDd17obTxFqeEZd36Cx8qMXmw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=qmC/1giZ; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=I7Llnfi3; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="qmC/1giZ"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="I7Llnfi3" Date: Mon, 25 Aug 2025 10:24:29 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1756117470; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zojrpvIkdaWsM8TBBWrFO/fK2YT46lS3BJZmKBpxq7o=; b=qmC/1giZOSv68Tgl03GdSKKHVN8KVgryBLLPoAw/CIWNFyW3/SykVFD1yXcE6+DM9+mRnd 9VPiScJuLBov8qYMFYPOOT3kzp3UOkcH9mXpbYESMrErYAMpTP7Zr2iMJDCryxS/pE1yBj rccHRfEOQ9eD7fjYcvFuruc8MgX/Yksc2R+qDZYUF5o/yc1M4AQ4AlMaFYq0mXy/azXZBm XTwrBxgNg40ZsJNojd/ODIrGpttLh+ofVmxBxY9CjNBrWsTKF6zybAUYmKAT/qSxXEgX6G qT/IsUgSHi43CwwCaTwsDvuTUhaFDaI/qUWU+vr25gUH5DSMhiyKQTnUNNDcCg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1756117470; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zojrpvIkdaWsM8TBBWrFO/fK2YT46lS3BJZmKBpxq7o=; b=I7Llnfi3UQxf+P9xLGv5Fcyn/8fn7BU8NiUXqn8/XP6TGb8+QPvTLlyJFoMHFBKC1wdGLt SZbjIfCsQjF+TSBg== From: "tip-bot2 for Dapeng Mi" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/core] perf/x86/intel: Use early_initcall() to hook bts_init() Cc: Dapeng Mi , "Peter Zijlstra (Intel)" , Kan Liang , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20250820023032.17128-2-dapeng1.mi@linux.intel.com> References: <20250820023032.17128-2-dapeng1.mi@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <175611746972.1420.7955373348082581195.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the perf/core branch of tip: Commit-ID: d9cf9c6884d21e01483c4e17479d27636ea4bb50 Gitweb: https://git.kernel.org/tip/d9cf9c6884d21e01483c4e17479d27636= ea4bb50 Author: Dapeng Mi AuthorDate: Wed, 20 Aug 2025 10:30:26 +08:00 Committer: Peter Zijlstra CommitterDate: Thu, 21 Aug 2025 20:09:26 +02:00 perf/x86/intel: Use early_initcall() to hook bts_init() After the commit 'd971342d38bf ("perf/x86/intel: Decouple BTS initialization from PEBS initialization")' is introduced, x86_pmu.bts would initialized in bts_init() which is hooked by arch_initcall(). Whereas init_hw_perf_events() is hooked by early_initcall(). Once the core PMU is initialized, nmi watchdog initialization is called immediately before bts_init() is called. It leads to the BTS buffer is not really initialized since bts_init() is not called and x86_pmu.bts is still false at that time. Worse, BTS buffer would never be initialized then unless all core PMU events are freed and reserve_ds_buffers() is called again. Thus aligning with init_hw_perf_events(), use early_initcall() to hook bts_init() to ensure x86_pmu.bts is initialized before nmi watchdog initialization. Fixes: d971342d38bf ("perf/x86/intel: Decouple BTS initialization from PEBS= initialization") Signed-off-by: Dapeng Mi Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kan Liang Link: https://lore.kernel.org/r/20250820023032.17128-2-dapeng1.mi@linux.int= el.com --- arch/x86/events/intel/bts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/events/intel/bts.c b/arch/x86/events/intel/bts.c index 61da6b8..cbac54c 100644 --- a/arch/x86/events/intel/bts.c +++ b/arch/x86/events/intel/bts.c @@ -643,4 +643,4 @@ static __init int bts_init(void) =20 return perf_pmu_register(&bts_pmu, "intel_bts", -1); } -arch_initcall(bts_init); +early_initcall(bts_init);