From nobody Tue Dec 16 07:30:55 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 1D4D4221FB7; Thu, 8 May 2025 10:34:30 +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=1746700472; cv=none; b=WtXZ1Hd0DezAsaSxq3fB3rcGzatWMQrmY9GLWab4YsDxVUHkl556X/ywl4ZFW8oFqslFoFhIO4Rp3XZKVlcvzrv1Er5TwyQQJUdWSsZAym+7PhiJvW+dVq/5V2GYA899+AHreDUSyTet3e4j4XdLtJ4zyHrx+r3WFIOnWr5vbQs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746700472; c=relaxed/simple; bh=f3sMbTwSXJ1iMUky/pzS2bRip+Z2tKZqocPe3Y5yvDg=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=gPPM/bRyfSkCW4DIqpdQyyV6HFeeYhaDmEeAUjs+Z51j24XG7uCxEjlAYvF+Lphiyqy6Piu8YgO2tyFWOWf96coegjw8QdhUGlmYs8d+tHGwd47nB/dcbiITA1DOVUtPxu8Kgnst8y4pOljXpgcAnEp+2ZtkPBwV4YfluYUbLfw= 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=cxMe0CYi; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=sV9l7M9w; 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="cxMe0CYi"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="sV9l7M9w" Date: Thu, 08 May 2025 10:34:28 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1746700469; 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=6pjwuWKz4D4H8tVb/poxc8rwU6B8H9b9+ACA/FKvUQI=; b=cxMe0CYiIEIH3VMcJqkcpsB5LA1lxw3O7IqZMfBf4ESzvR1Tyg7ouoLO5G6QFDfmmcCKz3 xasWtrsnQjc6qn2w+kI5OIBil9+aOMud692ru1qY1k6Sp0NPDClB3SYy5yCzPumOALLod6 I+KvSzOB5cZh0EpKSPaJBOWOSU/IhDeMluGNEAM115t6Ip1ckP8RXD/1LGusvnCwNKA1x4 47MDwbKdVy2a8a9UJ4GrOjs6ljcpxGUfTbvuognlsFMZxADJgG5u295AU002INigyQtgna P7FTqLfjummEnsvl56Tqe/hUGXO0U1v4efVa7prpZ4ly6tITGoXbvjPXQFJpug== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1746700469; 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=6pjwuWKz4D4H8tVb/poxc8rwU6B8H9b9+ACA/FKvUQI=; b=sV9l7M9wnJcCh9dAAmw/VrApIDGwic0/sz/9bGffR9lfSale+viqyg1t5uV/iNcuEaM5Dj nnLXhx3wLKfNQBBA== From: "tip-bot2 for Frederic Weisbecker" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/core] perf: Remove too early and redundant CPU hotplug handling Cc: Frederic Weisbecker , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20250424161128.29176-4-frederic@kernel.org> References: <20250424161128.29176-4-frederic@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <174670046846.406.16724744697892248650.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: 9d4ea6fdba71e56c7cf0231a0b0c44723f64c3e7 Gitweb: https://git.kernel.org/tip/9d4ea6fdba71e56c7cf0231a0b0c44723= f64c3e7 Author: Frederic Weisbecker AuthorDate: Thu, 24 Apr 2025 18:11:27 +02:00 Committer: Peter Zijlstra CommitterDate: Fri, 02 May 2025 12:40:41 +02:00 perf: Remove too early and redundant CPU hotplug handling The CPU hotplug handlers are called twice: at prepare and online stage. Their role is to: 1) Enable/disable a CPU context. This is irrelevant and even buggy at the prepare stage because the CPU is still offline. On early secondary CPU up, creating an event attached to that CPU might silently fail because the CPU context is observed as online but the context installation's IPI failure is ignored. 2) Update the scope cpumasks and re-migrate the events accordingly in the CPU down case. This is irrelevant at the prepare stage. 3) Remove the events attached to the context of the offlining CPU. It even uses an (unnecessary) IPI for it. This is also irrelevant at the prepare stage. Also none of the *_PREPARE and *_STARTING architecture perf related CPU hotplug callbacks rely on CPUHP_PERF_PREPARE. CPUHP_AP_PERF_ONLINE is enough and the right place to perform the work. Signed-off-by: Frederic Weisbecker Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20250424161128.29176-4-frederic@kernel.org --- include/linux/cpuhotplug.h | 1 - kernel/cpu.c | 5 ----- 2 files changed, 6 deletions(-) diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h index 1987400..df366ee 100644 --- a/include/linux/cpuhotplug.h +++ b/include/linux/cpuhotplug.h @@ -60,7 +60,6 @@ enum cpuhp_state { /* PREPARE section invoked on a control CPU */ CPUHP_OFFLINE =3D 0, CPUHP_CREATE_THREADS, - CPUHP_PERF_PREPARE, CPUHP_PERF_X86_PREPARE, CPUHP_PERF_X86_AMD_UNCORE_PREP, CPUHP_PERF_POWER, diff --git a/kernel/cpu.c b/kernel/cpu.c index b08bb34..a59e009 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -2069,11 +2069,6 @@ static struct cpuhp_step cpuhp_hp_states[] =3D { .teardown.single =3D NULL, .cant_stop =3D true, }, - [CPUHP_PERF_PREPARE] =3D { - .name =3D "perf:prepare", - .startup.single =3D perf_event_init_cpu, - .teardown.single =3D perf_event_exit_cpu, - }, [CPUHP_RANDOM_PREPARE] =3D { .name =3D "random:prepare", .startup.single =3D random_prepare_cpu,