mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Chuyi Zhou" <zhouchuyi@bytedance.com>
To: <tglx@kernel.org>, <mingo@redhat.com>, <luto@kernel.org>,
	 <peterz@infradead.org>, <paulmck@kernel.org>,
	<muchun.song@linux.dev>
Cc: <linux-kernel@vger.kernel.org>, "Chuyi Zhou" <zhouchuyi@bytedance.com>
Subject: [PATCH 0/2] smp: Fix CSD lock debug regressions
Date: Mon,  8 Jun 2026 19:23:47 +0800	[thread overview]
Message-ID: <20260608112349.3955175-1-zhouchuyi@bytedance.com> (raw)

This series fixes two regressions introduced by commit b0473dcd4b1d
("smp: Improve smp_call_function_single() CSD-lock diagnostics").

That commit made smp_call_function_single() use the destination CPU's
csd_data while CSD lock debugging is enabled.  This improves diagnostics,
but it changes two assumptions that the existing code relied on.

The first patch keeps invalid CPU numbers from being used for the
destination CPU csd_data lookup before generic_exec_single() has a chance
to reject them.  This preserves the existing -ENXIO path for callers such
as smp_call_function_any() when no online CPU can be selected.

The second patch makes csd_lock() acquire CSD_FLAG_LOCK atomically in the
debug configuration.  With destination CPU csd_data, multiple remote CPUs
can concurrently send async calls to the same target CPU and therefore
contend for the same CSD object.  The old non-atomic wait-then-set sequence
can let two senders enqueue the same llist node, corrupting
call_single_queue and leaving later synchronous callbacks stuck behind it.

The non-debug fast path keeps the existing wait-then-set sequence.

Chuyi Zhou (2):
  smp: Avoid invalid per-CPU CSD lookup with CSD lock debug
  smp: Make CSD lock acquisition atomic for debug mode

 kernel/smp.c | 29 ++++++++++++++++++++++++-----
 1 file changed, 24 insertions(+), 5 deletions(-)

-- 
2.20.1

             reply	other threads:[~2026-06-08 11:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-08 11:23 Chuyi Zhou [this message]
2026-06-08 11:23 ` [PATCH 1/2] smp: Avoid invalid per-CPU CSD lookup with CSD lock debug Chuyi Zhou
2026-06-08 11:23 ` [PATCH 2/2] smp: Make CSD lock acquisition atomic for debug mode Chuyi Zhou
2026-06-08 14:23   ` Paul E. McKenney

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=20260608112349.3955175-1-zhouchuyi@bytedance.com \
    --to=zhouchuyi@bytedance.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=muchun.song@linux.dev \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@kernel.org \
    /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®