From nobody Sun Feb 8 09:12:54 2026 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) (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 C3CD5204F73; Mon, 5 May 2025 12:58:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746449896; cv=none; b=YWhdmXIOPPA0SymwCxeJUXoLiyo87/1ybLM24iT70Ey9SvSPkA8+krPYSdwwhZvyZNlhIHh2Zlz8MilLLtO94GNSPdpyv+DlXZETc3f3d+syEGdX9FhqLx5soUkB+9uUT0/ay1hGrxpTX5nwDCeXVNOQhgRxYbFqEHoDqnXZqB4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746449896; c=relaxed/simple; bh=ghnAz5DXlB0g4w6x8ho8LIhTH3b9+CDKZZq/V5v6C78=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=eur6BmaUQ4xvYYpD8htwjqTkvFgDJmuncGPVvtltsZ1y0E0IvBh0hozZwebZ9U8uMfNOXG5N0zdFHuAEw/aBS1VwnU0AGAESpyovURqxa2nzHyoSJCRdwUyoKhdCult+ejVkuWp9kh72bgWcmIpN87T9HSDzwlwksijs4H4Fxs0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=DIp7zi41; arc=none smtp.client-ip=217.70.183.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="DIp7zi41" Received: by mail.gandi.net (Postfix) with ESMTPSA id EBCCA43B15; Mon, 5 May 2025 12:58:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1746449886; h=from:from: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; bh=DKscAiFBmnThbRC5lnXUx/DegagPTUs6LxbTAP23cNk=; b=DIp7zi41TqP9EbaCTyEGOS4dyXCCaXUq34CwIlXowL3fXfXA9TnmPhH7Z+XIlHvc9p79yR z0kbigfBTF3ZjSOisMPKwv+CP0qPFvZPnMuOxcIjCGpLmlMLG5LyfwXnRZsqjx8gFyUIKd bSjCYpcsI+1kYjAOFbeGtrMPaQm2I1GEDFtiQ81evhkr3/Z3FFW1Belc1Y1dqqVNthqpxz rMJXdki5q987bA8G6zo4hsyDJZLNje5PURtzht0zHzlWfS1DypdrDKyyaDZ8l5+9HYFkXk PCAacNCkfHjttegq8Oqr9tBxygVX2NepiS8Mwlxs6R+LV9xUZ/UbhT9tlkmJdg== From: Gregory CLEMENT Date: Mon, 05 May 2025 14:57:58 +0200 Subject: [PATCH] MIPS: SMP: Move the AP sync point before the non-parallel aware functions Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250505-hotplug-paralell-fix-v1-1-86f222cb6d90@bootlin.com> X-B4-Tracking: v=1; b=H4sIANW1GGgC/x2MQQqAMAwEv1JyNqDBCvoV8VDaqIGipVURxL8bZ E4zsPtA4SxcYDAPZL6kyL6pNJUBv7ptYZSgDlSTrRVc9yPFc8HksoscI85yI1mi1gei3neg05R Z8387Tu/7AfpoAI9mAAAA X-Change-ID: 20250505-hotplug-paralell-fix-25224cd229c6 To: Thomas Bogendoerfer Cc: Huacai Chen , Jiaxun Yang , Vladimir Kondratiev , =?utf-8?q?Th=C3=A9o_Lebrun?= , Tawfik Bayouk , Thomas Petazzoni , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Gregory CLEMENT X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvkeduudehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkvfevofesthekredtredtjeenucfhrhhomhepifhrvghgohhrhicuvefngffogffpvfcuoehgrhgvghhorhihrdgtlhgvmhgvnhhtsegsohhothhlihhnrdgtohhmqeenucggtffrrghtthgvrhhnpeetleefudeikeetjeejkeeuleeuvefhhfduudehjeefudfgtdeufeegheeggfevteenucffohhmrghinhepkhgvrhhnvghlrdhorhhgpdgsohhothhlihhnrdgtohhmnecukfhppedvrgdtudemtggsudegmeehheeimeejrgdttdemfeekfeekmeekhegvleemfhgsuddvmeehleelrgenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvrgdtudemtggsudegmeehheeimeejrgdttdemfeekfeekmeekhegvleemfhgsuddvmeehleelrgdphhgvlhhopehlohgtrghlhhhoshhtpdhmrghilhhfrhhomhepghhrvghgohhrhidrtghlvghmvghnthessghoohhtlhhinhdrtghomhdpnhgspghrtghpthhtohepuddtpdhrtghpthhtohepthhhohhmrghsrdhpvghtrgiiiihonhhisegsohhothhlihhnrdgtohhmpdhrtghpthhtohepthhssghoghgvnhgusegrlhhphhgrrdhfrhgrnhhkv ghnrdguvgdprhgtphhtthhopegthhgvnhhhuhgrtggriheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepghhrvghgohhrhidrtghlvghmvghnthessghoohhtlhhinhdrtghomhdprhgtphhtthhopehthhgvohdrlhgvsghruhhnsegsohhothhlihhnrdgtohhmpdhrtghpthhtoheplhhinhhugidqmhhiphhssehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepvhhlrgguihhmihhrrdhkohhnughrrghtihgvvhesmhhosghilhgvhigvrdgtohhm X-GND-Sasl: gregory.clement@bootlin.com When CONFIG_HOTPLUG_PARALLEL is enabled, the code executing before cpuhp_ap_sync_alive() is executed in parallel, while after it is serialized. The functions set_cpu_sibling_map() and set_cpu_core_map() were not designed to be executed in parallel, so by moving the cpuhp_ap_sync_alive() before cpuhp_ap_sync_alive(), we then ensure they will be called serialized. The measurement done on EyeQ5 did not show any relevant boot time increase after applying this patch. Reported-by: Huacai Chen Signed-off-by: Gregory CLEMENT --- Hello, As discussed last week [1], this is the patch that fixes the potential issue with the functions set_cpu_sibling_map() and set_cpu_core_map(). Gregory [1]: https://lore.kernel.org/all/aBVBHFGH2kICjnT3@alpha.franken.de/ --- arch/mips/kernel/smp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c index 1726744f2b2ec10a44420a7b9b9cd04f06c4d2f6..7901b59d8f60eddefc020cf2a13= 7716af963f09e 100644 --- a/arch/mips/kernel/smp.c +++ b/arch/mips/kernel/smp.c @@ -374,13 +374,13 @@ asmlinkage void start_secondary(void) calibrate_delay(); cpu_data[cpu].udelay_val =3D loops_per_jiffy; =20 +#ifdef CONFIG_HOTPLUG_PARALLEL + cpuhp_ap_sync_alive(); +#endif set_cpu_sibling_map(cpu); set_cpu_core_map(cpu); =20 cpumask_set_cpu(cpu, &cpu_coherent_mask); -#ifdef CONFIG_HOTPLUG_PARALLEL - cpuhp_ap_sync_alive(); -#endif notify_cpu_starting(cpu); =20 #ifndef CONFIG_HOTPLUG_PARALLEL --- base-commit: 3b3704261e851e25983860e4c352f1f73786f4ab change-id: 20250505-hotplug-paralell-fix-25224cd229c6 Best regards, --=20 Gr=C3=A9gory CLEMENT, Bootlin Embedded Linux and Kernel engineering https://bootlin.com