From nobody Fri Jul 24 21:53:25 2026 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 3B1FD43B3CD; Thu, 23 Jul 2026 10:21:29 +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=1784802091; cv=none; b=V+X46yKd6w1pDv8MiOOORLipmrJ6Kxg0Ua7PKZjGugdJVt5V+npR09X48lliZhBDkYlYXDgSOuOyRpgjS9SBe8YnQOx8/v1eUzEG4nt13af7R0bS/QM1IJD9Fv+55NfzfVqbOnTn2hKgrNRZ2GEnAwuVjI2vVnNQc0mPe4Qt4W4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784802091; c=relaxed/simple; bh=eJ9JQnamKuX5oO37YuNuN3lgb4QvDaf3+5WRTScGvLQ=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=fYWiuuEVoPuivVc720wY7fA1DrhNvYgFCl9hIFrPf/wNUyVpEGkBTZ5FtPxcyGBGO/jySXduumX7iiqoxepOSTiFV0ERMMCu28yo8TWJsiFYU9xH0pS3sn/Ka7isueT/Fq1b6zTB1snxngDMhHN+PDq65GQ0efty6KznlbUOtX0= 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=iExwiflQ; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=teMrQZDA; 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="iExwiflQ"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="teMrQZDA" Date: Thu, 23 Jul 2026 10:21:26 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1784802088; 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=g4lkpIj0P7wwZ0RvlTz7m0E0JP6ttiExrGHqTqnErto=; b=iExwiflQg+8e30hwh8Z3/LzDggcmg5kAvBNAuzsJynwz3zz54fYdTJefuW7r1jTfuNP+s1 cl5cbIzTVkPynWYLNeLVONYF+ND0Gq/zkdK6rC5N9bMMJF6y5jIvsvNvSNi6p44ynVwmZQ pKLSzdgGmRdsVz26q2Mv/smBi+e5H6ykPovb95WuqJ4GzzFFcJUaVT5l0Yc6B6c1eVsJGi noQb/2TBCtRR4/LzqKzClO1PyFZ6fBgrr1TIJiA7RRR9oJw90id08NS/jaOOQHdx99VOfd MHDT/qy5BinsFJLT29lJDvSdYJdU/yU6/WQeVUsRvoiQJbHGYfoNJwCY+Dx4gQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1784802088; 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=g4lkpIj0P7wwZ0RvlTz7m0E0JP6ttiExrGHqTqnErto=; b=teMrQZDAMCUNdLeiUiW5xVjotTszUIsC2DgAoCjWZeOuyy2gaqWSaCNJC66Sr2X7/apnxI tuik1cdieP9X9tAQ== From: "tip-bot2 for Chuyi Zhou" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: smp/core] smp: Disable preemption explicitly in __csd_lock_wait() Cc: Chuyi Zhou , Thomas Gleixner , "Paul E. McKenney" , "Steven Rostedt (Google)" , Sebastian Andrzej Siewior , Muchun Song , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260709122933.4021501-2-zhouchuyi@bytedance.com> References: <20260709122933.4021501-2-zhouchuyi@bytedance.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <178480208689.2943223.5139302276528601685.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 smp/core branch of tip: Commit-ID: b46883305f26188bf0555d06e77f43ab01d5ec95 Gitweb: https://git.kernel.org/tip/b46883305f26188bf0555d06e77f43ab0= 1d5ec95 Author: Chuyi Zhou AuthorDate: Thu, 09 Jul 2026 20:29:20 +08:00 Committer: Thomas Gleixner CommitterDate: Thu, 16 Jul 2026 09:24:55 +02:00 smp: Disable preemption explicitly in __csd_lock_wait() The CSD lock wait debugging code in __csd_lock_wait() must run with preemption disabled. The smp function call mechanisms which invoke it currently keep preemption disabled across the wait, so the debugging code inherits that guarantee from its callers. Keeping preemption disabled across the whole smp function call operation can induce large scheduling latencies. Shortening the caller-side preemption-disabled region would invoke __csd_lock_wait() with preemption enabled. Prepare for that by disabling preemption explicitly around the CSD lock wait debugging code in __csd_lock_wait(). Signed-off-by: Chuyi Zhou Signed-off-by: Thomas Gleixner Tested-by: Paul E. McKenney Reviewed-by: Steven Rostedt (Google) Reviewed-by: Sebastian Andrzej Siewior Acked-by: Muchun Song Link: https://patch.msgid.link/20260709122933.4021501-2-zhouchuyi@bytedance= .com --- kernel/smp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/smp.c b/kernel/smp.c index 8a847a3..f5a4d63 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -335,6 +335,8 @@ static void __csd_lock_wait(call_single_data_t *csd) int bug_id =3D 0; u64 ts0, ts1; =20 + guard(preempt)(); + ts1 =3D ts0 =3D ktime_get_mono_fast_ns(); for (;;) { if (csd_lock_wait_toolong(csd, ts0, &ts1, &bug_id, &nmessages))