From: "tip-bot2 for Chuyi Zhou" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Chuyi Zhou <zhouchuyi@bytedance.com>,
Thomas Gleixner <tglx@kernel.org>,
"Paul E. McKenney" <paulmck@kernel.org>,
"Steven Rostedt (Google)" <rostedt@goodmis.org>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Muchun Song <muchun.song@linux.dev>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: smp/core] smp: Disable preemption explicitly in __csd_lock_wait()
Date: Thu, 23 Jul 2026 10:21:26 -0000 [thread overview]
Message-ID: <178480208689.2943223.5139302276528601685.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20260709122933.4021501-2-zhouchuyi@bytedance.com>
The following commit has been merged into the smp/core branch of tip:
Commit-ID: b46883305f26188bf0555d06e77f43ab01d5ec95
Gitweb: https://git.kernel.org/tip/b46883305f26188bf0555d06e77f43ab01d5ec95
Author: Chuyi Zhou <zhouchuyi@bytedance.com>
AuthorDate: Thu, 09 Jul 2026 20:29:20 +08:00
Committer: Thomas Gleixner <tglx@kernel.org>
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 <zhouchuyi@bytedance.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Tested-by: Paul E. McKenney <paulmck@kernel.org>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Muchun Song <muchun.song@linux.dev>
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 = 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))
next prev parent reply other threads:[~2026-07-23 10:21 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 12:29 [PATCH v10 00/14] Allow preemption during IPI completion waiting to improve real-time performance Chuyi Zhou
2026-07-09 12:29 ` [PATCH v10 01/14] smp: Disable preemption explicitly in __csd_lock_wait() Chuyi Zhou
2026-07-23 10:21 ` tip-bot2 for Chuyi Zhou [this message]
2026-07-09 12:29 ` [PATCH v10 02/14] smp: Enable preemption early in smp_call_function_single() Chuyi Zhou
2026-07-23 10:21 ` [tip: smp/core] " tip-bot2 for Chuyi Zhou
2026-07-09 12:29 ` [PATCH v10 03/14] smp: Refactor remote CPU selection in smp_call_function_any() Chuyi Zhou
2026-07-23 10:21 ` [tip: smp/core] " tip-bot2 for Chuyi Zhou
2026-07-09 12:29 ` [PATCH v10 04/14] smp: Use task-local IPI cpumask in smp_call_function_many_cond() Chuyi Zhou
2026-07-23 10:21 ` [tip: smp/core] " tip-bot2 for Chuyi Zhou
2026-07-09 12:29 ` [PATCH v10 05/14] smp: Alloc percpu csd data in smpcfd_prepare_cpu() only once Chuyi Zhou
2026-07-23 10:21 ` [tip: smp/core] " tip-bot2 for Chuyi Zhou
2026-07-09 12:29 ` [PATCH v10 06/14] smp: Enable preemption early in smp_call_function_many_cond() Chuyi Zhou
2026-07-23 10:21 ` [tip: smp/core] " tip-bot2 for Chuyi Zhou
2026-07-09 12:29 ` [PATCH v10 07/14] smp: Remove preempt_disable() from smp_call_function() Chuyi Zhou
2026-07-23 10:21 ` [tip: smp/core] " tip-bot2 for Chuyi Zhou
2026-07-09 12:29 ` [PATCH v10 08/14] smp: Remove preempt_disable() from on_each_cpu_cond_mask() Chuyi Zhou
2026-07-23 10:21 ` [tip: smp/core] " tip-bot2 for Chuyi Zhou
2026-07-09 12:29 ` [PATCH v10 09/14] scftorture: Remove preempt_disable() in scftorture_invoke_one() Chuyi Zhou
2026-07-23 10:21 ` [tip: smp/core] " tip-bot2 for Chuyi Zhou
2026-07-09 12:29 ` [PATCH v10 10/14] x86/mm: Factor out flush_tlb_info initialization Chuyi Zhou
2026-07-23 10:32 ` [tip: x86/mm] " tip-bot2 for Chuyi Zhou
2026-07-09 12:29 ` [PATCH v10 11/14] x86/mm: Cap flush_tlb_info alignment at 64 bytes Chuyi Zhou
2026-07-23 10:32 ` [tip: x86/mm] " tip-bot2 for Chuyi Zhou
2026-07-09 12:29 ` [PATCH v10 12/14] x86/mm: Move flush_tlb_info back to the stack Chuyi Zhou
2026-07-23 10:32 ` [tip: x86/mm] " tip-bot2 for Chuyi Zhou
2026-07-09 12:29 ` [PATCH v10 13/14] x86/kvm: Disable preemption in kvm_flush_tlb_multi() Chuyi Zhou
2026-07-23 10:32 ` [tip: x86/mm] " tip-bot2 for Chuyi Zhou
2026-07-09 12:29 ` [PATCH v10 14/14] x86/mm: Re-enable preemption before flush_tlb_multi() Chuyi Zhou
2026-07-23 10:32 ` [tip: x86/mm] " tip-bot2 for Chuyi Zhou
2026-07-16 14:14 ` [PATCH v10 00/14] Allow preemption during IPI completion waiting to improve real-time performance Chuyi Zhou
2026-07-16 21:18 ` Thomas Gleixner
2026-07-23 19:26 ` Borislav Petkov
2026-07-24 3:08 ` Chuyi Zhou
2026-08-11 21:22 ` Borislav Petkov
2026-08-12 3:56 ` Chuyi Zhou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178480208689.2943223.5139302276528601685.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=bigeasy@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=muchun.song@linux.dev \
--cc=paulmck@kernel.org \
--cc=rostedt@goodmis.org \
--cc=tglx@kernel.org \
--cc=x86@kernel.org \
--cc=zhouchuyi@bytedance.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®