Skip to content

bcachefs async object debugging

Kent Overstreet linux-bcachefs 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5bcachefs: bch2_bio_to_text()fs/bcachefs/util.c fs/bcachefs/util.h+12 -00 replies
2/5bcachefs: bch2_read_bio_to_textfs/bcachefs/data_update.c fs/bcachefs/io_read.c fs/bcachefs/io_read.h+52 -30 replies
3/5bcachefs: fast_listfs/bcachefs/Makefile fs/bcachefs/fast_list.c fs/bcachefs/fast_list.h+182 -00 replies
4/5bcachefs: Async object debuggingfs/bcachefs/Kconfig fs/bcachefs/Makefile fs/bcachefs/async_objs.c +7 more+220 -320 replies
5/5bcachefs: Make various async objs visible in debugfsfs/bcachefs/async_objs.c fs/bcachefs/async_objs_types.h fs/bcachefs/btree_io.c +4 more+102 -150 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5] bcachefs async object debugging

More debugging infrastructure that might perhaps be of wider interest.

Currently, when an asynchronous op gets stuck and never completes, it's a real problem to debug: all our normal introspection (e.g. /proc/pid/stack) doesn't work.

e.g. if a bio doesn't (seem to) complete - what happened to it? Difficult question to answer. We have giant state machines, and debugging issues where we stop making forward progress requires visibility into the whole thing.

(basic question: did the bio complete and the endio not funtion not flip the correct state bit, or did it get lost?)

In the reports/test failures I look at, I've been seeing these the most in or at the boundary of mm - compaction/migration, writeback...

This series introduces infrastructure that'll allow us to debug these kinds of issues in production:

- fast_list, which is a high-enough performance "list" to track these kinds of objects (radix tree + percpu buffer)

- infrastructure for making them visible in debugfs, hooking them up to pretty printers

- and the last patch hooks into just some of the bcachefs paths where we we need this

Kent Overstreet (5):
bcachefs: bch2_bio_to_text()
bcachefs: bch2_read_bio_to_text
bcachefs: fast_list
bcachefs: Async object debugging
bcachefs: Make various async objs visible in debugfs

 fs/bcachefs/Kconfig            |   5 ++
 fs/bcachefs/Makefile           |   3 +
 fs/bcachefs/async_objs.c       | 126 +++++++++++++++++++++++++++++
 fs/bcachefs/async_objs.h       |  39 +++++++++
 fs/bcachefs/async_objs_types.h |  24 ++++++
 fs/bcachefs/bcachefs.h         |   7 ++
 fs/bcachefs/btree_io.c         |  12 +++
 fs/bcachefs/btree_io.h         |   8 ++
 fs/bcachefs/data_update.c      |  18 ++++-
 fs/bcachefs/data_update.h      |  15 ++++
 fs/bcachefs/debug.c            |  52 +++++-------
 fs/bcachefs/debug.h            |  18 +++++
 fs/bcachefs/errcode.h          |   1 +
 fs/bcachefs/fast_list.c        | 140 +++++++++++++++++++++++++++++++++
 fs/bcachefs/fast_list.h        |  41 ++++++++++
 fs/bcachefs/io_read.c          |  76 +++++++++++++++---
 fs/bcachefs/io_read.h          |  14 ++++
 fs/bcachefs/super.c            |   3 +
 fs/bcachefs/util.c             |  10 +++
 fs/bcachefs/util.h             |   2 +
 20 files changed, 566 insertions(+), 48 deletions(-)
 create mode 100644 fs/bcachefs/async_objs.c
 create mode 100644 fs/bcachefs/async_objs.h
 create mode 100644 fs/bcachefs/async_objs_types.h
 create mode 100644 fs/bcachefs/fast_list.c
 create mode 100644 fs/bcachefs/fast_list.h
Signature · 1 line
2.49.0