From mboxrd@z Thu Jan 1 00:00:00 1970 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 44CBA421EE2 for ; Wed, 13 May 2026 12:46:09 +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=1778676371; cv=none; b=hLzYR3JWqOB8ze5wqxbJo5ysjxm4qeAgHBO36whwbakBRaT/S6MMaWIBfFbguWXTRdho3ji04OEkDBAAWSkODc9eknZCdMh1UijQ+FFRsqjbJq0EbhJW4xH6AfGFBUDKLhaDLKiVKz/LchG1m03lV/dnIQ+YCKIR3su20Q4rBuA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778676371; c=relaxed/simple; bh=Jh+uClddCca3FSI+mbTK83nxf3SnGFzmGxb6aJS9x14=; h=Mime-Version:In-Reply-To:Content-Type:Cc:References:To:From:Date: Message-Id:Subject; b=SAiHYNaGk6BcB0AilcqzrQI8S/Q39ZDDSwJLJ1SoEOX4Z7aKvR8595h8RHIueq4Br2ipBAHPx23zIN4N16i7STy2txrQMzUVGcRwSdKE2yy+6RDWqfnNQnK09PZMpPuvUn7TR6rS1zTjmPEimpiOIvnNSN4MYCz/+vWlYznj+yM= 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=VVyBh2fR; 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="VVyBh2fR" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=2212171451; d=bytedance.com; t=1778676364; h=from:subject: mime-version:from:date:message-id:subject:to:cc:reply-to:content-type: mime-version:in-reply-to:message-id; bh=AQ5azY1la9Qq56fewVs7n4m/FZ8PJQBk4PtZGiWCpJI=; b=VVyBh2fRbVR/PjFAOve9jW79vzeDZqqQgDQ19Qis1pTpt3azwObH4wVGxQZHRSF9e+1DTg kpJ0++xSfpXXQ6ecxNBsJukoKuog9T1ZG3a7ihrZzKwnLyqGscw1GHvQtxZd6JHNrMW/Dm xM/aQSu4n+n9syzOUyabcq7N7rAq15VhGHlhfSf23m3LV7E720HFY6QSnbznOVO+bRuQXa 0Ab1gyIWHCM3y+YGIA+ZzuSfoF3kuZoiAG1HKRalWnwUyMD1KJQY0cZ+9fy4RlhJ4z9Z0E +mEx/v1EAqhrY0x/aZ7Wg0/7a4hk9UyDXAOam5ytCWJrW+UQctHZn4QsGSXY+A== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 In-Reply-To: <20260513124524.2569867-1-zhouchuyi@bytedance.com> Content-Type: text/plain; charset=UTF-8 Cc: , "Chuyi Zhou" X-Lms-Return-Path: References: <20260513124524.2569867-1-zhouchuyi@bytedance.com> Content-Transfer-Encoding: 7bit To: , , , , , , , , , , , , From: "Chuyi Zhou" Date: Wed, 13 May 2026 20:45:13 +0800 Message-Id: <20260513124524.2569867-2-zhouchuyi@bytedance.com> X-Original-From: Chuyi Zhou X-Mailer: git-send-email 2.20.1 Subject: [RESEND PATCH v5 01/12] smp: Disable preemption explicitly in __csd_lock_wait 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 a0bb56bd8dda..b58975480e11 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 = 0; u64 ts0, ts1; + guard(preempt)(); + ts1 = ts0 = ktime_get_mono_fast_ns(); for (;;) { if (csd_lock_wait_toolong(csd, ts0, &ts1, &bug_id, &nmessages)) -- 2.20.1