From nobody Wed Apr 1 11:33:15 2026 Received: from va-1-112.ptr.blmpb.com (va-1-112.ptr.blmpb.com [209.127.230.112]) (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 964813D811D for ; Tue, 31 Mar 2026 11:31:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.127.230.112 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774956713; cv=none; b=B/sxfaJ/oRETbx0j9+jj4CW0ojRniqDkU3fwjWST4DJw8IsQO8zR7oEimxFwal9wkrF9Ue+OByao43veUc1wncvAo6+fGzPJGFHnBPPy0Kg7DLakkCDgIDQE4vDqs4yBwV7NmlxaTmY+VBZqrnxXGHnjiHGe02WxYA0ZKyJQr4A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774956713; c=relaxed/simple; bh=Yr7hPbFJqPhwhA4yLJOLlIwqQ4YC5o5sOhMGOPQF0y0=; h=Mime-Version:In-Reply-To:Cc:Subject:To:Message-Id:From:Date: References:Content-Type; b=oAi5y+mIwDu1ej6rTld5A3i5HuW9cUz8cmMnuZZbPBQGTrIW+F8IXo9doxzKZM5dMZHT3z1GA1PQvGu/taONVDPNXskTLSXH2pR8F+AixWmHzdTbMuFf7PzB/mVfZtuInAUtwTqeXPEC979iB0XrNE8EwtpD5qcHlLe3eRHCDzg= 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=Imb3sLOj; arc=none smtp.client-ip=209.127.230.112 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="Imb3sLOj" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=2212171451; d=bytedance.com; t=1774956700; h=from:subject: mime-version:from:date:message-id:subject:to:cc:reply-to:content-type: mime-version:in-reply-to:message-id; bh=4qJqU4VfR4Arq9FDA14N+IzDSZhq+TH2zib4qVKbcC0=; b=Imb3sLOjrMXQAP1ujDsCQo7BP9fxLANCwYjlCwB2451DwEgmVigiT1kkPJC8aIMs5myObj iYUNlPajpPMrgzPQBRue6ZZZ/IGBt6V074eCih+eZr69unBIg395GHR7V4lIIW2c0EIsC5 0Ki3pYO/1ymPXWVC8KPrkCEROfjOPqYqPiKQRuR8lh9VSV8YMaBsq+zMr9PPB6oJgedbII sAgl3JwBfSIMOd+k3CTaoZkN6+CBLhGzKWiatRESr8Jq5HZ0Sw5C+xA93lVJYZXtts0OxY Z4RUcVbGq1aFiV0baPIy3YjN3bl6mq5fcWtOekVNCJieybMur+t8U6Q+gXYyxA== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 In-Reply-To: <20260331113103.2197007-1-zhouchuyi@bytedance.com> X-Mailer: git-send-email 2.20.1 X-Original-From: Chuyi Zhou Cc: , "Chuyi Zhou" Subject: [PATCH v4 01/12] smp: Disable preemption explicitly in __csd_lock_wait Content-Transfer-Encoding: quoted-printable To: , , , , , , , , , , , , Message-Id: <20260331113103.2197007-2-zhouchuyi@bytedance.com> X-Lms-Return-Path: From: "Chuyi Zhou" Date: Tue, 31 Mar 2026 19:30:52 +0800 References: <20260331113103.2197007-1-zhouchuyi@bytedance.com> 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 Reviewed-by: Steven Rostedt (Google) --- 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