From: Kent Overstreet <kent.overstreet@linux.dev>
To: linux-bcachefs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Subject: [PATCH 0/5] bcachefs async object debugging
Date: Mon, 21 Apr 2025 13:26:00 -0400 [thread overview]
Message-ID: <20250421172607.1781982-1-kent.overstreet@linux.dev> (raw)
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
--
2.49.0
next reply other threads:[~2025-04-21 17:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-21 17:26 Kent Overstreet [this message]
2025-04-21 17:26 ` [PATCH 1/5] bcachefs: bch2_bio_to_text() Kent Overstreet
2025-04-21 17:26 ` [PATCH 2/5] bcachefs: bch2_read_bio_to_text Kent Overstreet
2025-04-21 17:26 ` [PATCH 3/5] bcachefs: fast_list Kent Overstreet
2025-04-21 17:26 ` [PATCH 4/5] bcachefs: Async object debugging Kent Overstreet
2025-04-21 17:26 ` [PATCH 5/5] bcachefs: Make various async objs visible in debugfs Kent Overstreet
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=20250421172607.1781982-1-kent.overstreet@linux.dev \
--to=kent.overstreet@linux.dev \
--cc=linux-bcachefs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.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;
as well as URLs for NNTP newsgroup(s).