From nobody Tue Feb 10 12:57:34 2026 Received: from sg-1-102.ptr.blmpb.com (sg-1-102.ptr.blmpb.com [118.26.132.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4486A2652B6 for ; Tue, 3 Feb 2026 11:25:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=118.26.132.102 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770117912; cv=none; b=DEPGrjFblkix1dOruUnFOw+CF2NaSXZ+cxQoxF5jbNaRFyTA2k7t8wFvkubiIDHIcIPf4EyKqv1ZdITBsg82YwGLqR50qVsCog5q35qWiHHra3PI2Ez7nDLsPDzTOp452xGtLvtNZwDtT2PWPOo3KddPZ1VrgTCMjLVOaFLBzWo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770117912; c=relaxed/simple; bh=GCGOcQqtvk/19f8vftEKqC2/G2Ep9scqa/joti9V7jY=; h=Cc:Message-Id:To:Date:Mime-Version:In-Reply-To:References: Content-Type:From:Subject; b=kXFtsPzm6x/UqL2ZjNf1sCjQ6pGUMz9uBfiDTxnfC7MpFQ6CPMej2ornqFYc0MTA/jRs/OKX7dOYP4uBpw1oGFW6MUsnBLtyBPoPH3hQ6ihLUc6yFYXahCMFrTXEGRdk4HRxpbXJKaDqSFdwxRs0E+GWc+eaQ/yU7NDGtdKIaMU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=BQljZZdH; arc=none smtp.client-ip=118.26.132.102 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="BQljZZdH" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=2212171451; d=bytedance.com; t=1770117898; h=from:subject: mime-version:from:date:message-id:subject:to:cc:reply-to:content-type: mime-version:in-reply-to:message-id; bh=xsWddccpnpFM5L4OYeRPd3cPjoAsrE9YsBUvxquv4vw=; b=BQljZZdHRBGSa3ZYZaX381q/rIaiRGExCY0WdBichULOG1ZuvZKBvj2JAJ1MXxcMAHdiHJ 5MPcDneadeNtUEPFGz9YzIOS5lISI65m4FxBXBHCrKpAJo+WTzEbCBCVYbQXFjq8XdzhLr GS+QlVEMSbqhnW1o6vlJUevGGpVQuVOKNY9dhjk9idxqNlx5ojwfz2YQ7nH2DwKZ8jABj7 N1cq/M6gmq//XR92GeUvTKhcQcaOS4dNQUw+Rs7+MBRDOefkYeLIclTvkAsHjydVZgc1oa bTCxmNqOHRKxt0Z1FH32d+owIrRWsg0mpLP/xMFwu40fDJjJ4zAGchSFqx5QUA== Cc: , "Chuyi Zhou" Message-Id: <20260203112401.3889029-2-zhouchuyi@bytedance.com> X-Original-From: Chuyi Zhou To: , , , , , , , Date: Tue, 3 Feb 2026 19:23:51 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 In-Reply-To: <20260203112401.3889029-1-zhouchuyi@bytedance.com> References: <20260203112401.3889029-1-zhouchuyi@bytedance.com> X-Lms-Return-Path: From: "Chuyi Zhou" X-Mailer: git-send-email 2.20.1 Subject: [PATCH 01/11] smp: Disable preemption explicitly in __csd_lock_wait Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The latter patches will enable preemption before csd_lock_wait(), which could break csdlock_debug. Because the slice of other tasks on the CPU may be accounted between ktime_get_mono_fast_ns() calls. Disable preemption explicitly in __csd_lock_wait(). This is a preparation for the next patches. Signed-off-by: Chuyi Zhou Acked-by: Muchun Song --- kernel/smp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/smp.c b/kernel/smp.c index f349960f79ca..fc1f7a964616 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -323,6 +323,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)) --=20 2.20.1