mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/3] locking/csd-lock: Report how long a CSD stall lasted
@ 2026-08-10 11:29 Breno Leitao
  2026-08-10 11:29 ` [PATCH v2 1/3] locking/csd-lock: Pack csd_lock_wait_toolong() state into a struct Breno Leitao
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Breno Leitao @ 2026-08-10 11:29 UTC (permalink / raw)
  To: paulmck, Andrew Morton, d
  Cc: linux-kernel, Peter Zijlstra, Ingo Molnar,
	Sebastian Andrzej Siewior, linux-kernel, kernel-team,
	Thomas Gleixner, Breno Leitao

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>


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-08-12  0:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-10 11:29 [PATCH v2 0/3] locking/csd-lock: Report how long a CSD stall lasted Breno Leitao
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
2026-08-12  0:14 ` [PATCH v2 0/3] locking/csd-lock: Report how long a CSD stall lasted Paul E. McKenney

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®