From: Ioannis Angelakopoulos <iangelak@fb.com>
To: <linux-btrfs@vger.kernel.org>, <kernel-team@fb.com>
Subject: [RFC PATCH 0/2] btrfs: Add a lockdep annotation for the extent bits wait event
Date: Thu, 11 Aug 2022 17:42:40 -0700 [thread overview]
Message-ID: <20220812004241.1722846-1-iangelak@fb.com> (raw)
Hello,
with this patch series we add a lockdep annotation for the extent bits
wait event.
Unfortunately, as it stands this wait event cannot be annotated in a
generic way. Specifically, there are cases where the extent bits are
locked in one execution context (we have to acquire the lockdep map
there) and they are unlocked in another execution context (we have to
release the lockdep map there). However, lockdep expects both the
acquisition and release of the lockdep map to occur in the same context.
Thus, we opted to manually annotate five important functions that lock
extent bits and can be involved in a convoluted deadlock (see
https://lore.kernel.org/linux-btrfs/cover.1655147296.git.josef@toxicpanda.com/)
These functions are:
1) find_lock_delalloc_range
2) btrfs_lock_and_flush_ordered_range
3) extent_fiemap
4) btrfs_fallocate
5) btrfs_finish_ordered_io
Important!!! This patch series depends on this patch series
https://lore.kernel.org/linux-btrfs/20220812001734.1587514-1-iangelak@fb.com/T/#t
Ioannis Angelakopoulos (2):
btrfs: Add lockdep wrappers around the extent bits locking and
unlocking functions
btrfs: Lockdep annotations for the extent bits wait event
fs/btrfs/ctree.h | 1 +
fs/btrfs/disk-io.c | 1 +
fs/btrfs/extent-io-tree.h | 32 ++++++++++
fs/btrfs/extent_io.c | 114 ++++++++++++++++++++++++++++++++---
fs/btrfs/file.c | 10 +--
fs/btrfs/free-space-cache.c | 1 +
fs/btrfs/inode.c | 22 +++++--
fs/btrfs/ordered-data.c | 4 +-
include/trace/events/btrfs.h | 1 +
9 files changed, 167 insertions(+), 19 deletions(-)
--
2.30.2
next reply other threads:[~2022-08-12 0:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-12 0:42 Ioannis Angelakopoulos [this message]
2022-08-12 0:42 ` [RFC PATCH 1/2] btrfs: Add lockdep wrappers around the extent bits locking and unlocking functions Ioannis Angelakopoulos
2022-08-12 0:42 ` [RFC PATCH 2/2] btrfs: Lockdep annotations for the extent bits wait event Ioannis Angelakopoulos
2022-08-23 21:02 ` David Sterba
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=20220812004241.1722846-1-iangelak@fb.com \
--to=iangelak@fb.com \
--cc=kernel-team@fb.com \
--cc=linux-btrfs@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