From: Breno Leitao <leitao@debian.org>
To: paulmck@kernel.org, Andrew Morton <akpm@linux-foundation.org>,
d@ilvokhin.com
Cc: linux-kernel@vger.kernel.org,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
linux-kernel@vger.kernel.org, kernel-team@meta.com,
Thomas Gleixner <tglx@kernel.org>,
Breno Leitao <leitao@debian.org>
Subject: [PATCH v2 0/3] locking/csd-lock: Report how long a CSD stall lasted
Date: Mon, 10 Aug 2026 04:29:23 -0700 [thread overview]
Message-ID: <20260810-csd-stall-duration-v2-0-795083bf04a4@debian.org> (raw)
The CSD lock debug code says when a CPU stops answering an IPI and when it
finally answers, but the recovery line leaves out how long the stall
lasted, even though csd_lock_wait_toolong() has the timestamp the wait
started from. On Meta's fleet that line fired 211K times in the last 24
hours, none of them with a duration.
Patch 1 packs the state that csd_lock_wait_toolong() carries across the
polling loop into a struct, as suggested on v1, which gives the timestamps
names and leaves room for another one. Patch 2 prints how long the lock
was stuck and, when the IPI was re-sent, how long after the last re-send
the target released it.
I've created a simple selftest to test both patches, and I am including
it here, given it might be helpful for whoever is hacking this code.
---
Changes in v2:
- Add patch 1, packing csd_lock_wait_toolong() state into a struct, as
suggested by Dmitry Ilvokhin.
- Add patch 3, a module that stalls a CPU so the reporting can be exercised.
- Link to v1: https://patch.msgid.link/20260805-csd-stall-duration-v1-1-71134fafe150@debian.org
---
Breno Leitao (3):
locking/csd-lock: Pack csd_lock_wait_toolong() state into a struct
locking/csd-lock: Report how long a stuck CSD lock took to recover
lib/test_csd_lock: Add a module to stall a CPU on a CSD lock
kernel/smp.c | 77 +++++++++++++++--------
lib/Kconfig.debug | 12 ++++
lib/Makefile | 1 +
lib/test_csd_lock.c | 173 ++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 237 insertions(+), 26 deletions(-)
---
base-commit: f9a2394a23482bfd330911e9c8295b71724feacd
change-id: 20260805-csd-stall-duration-3385343d7a08
Best regards,
--
Breno Leitao <leitao@debian.org>
next reply other threads:[~2026-08-10 11:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 11:29 Breno Leitao [this message]
2026-08-10 11:29 ` [PATCH v2 1/3] locking/csd-lock: Pack csd_lock_wait_toolong() state into a struct Breno Leitao
2026-08-10 14:32 ` Dmitry Ilvokhin
2026-08-10 11:29 ` [PATCH v2 2/3] locking/csd-lock: Report how long a stuck CSD lock took to recover Breno Leitao
2026-08-10 11:29 ` [PATCH v2 3/3] lib/test_csd_lock: Add a module to stall a CPU on a CSD lock Breno Leitao
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=20260810-csd-stall-duration-v2-0-795083bf04a4@debian.org \
--to=leitao@debian.org \
--cc=akpm@linux-foundation.org \
--cc=bigeasy@linutronix.de \
--cc=d@ilvokhin.com \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--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