From: "Darrick J. Wong" <djwong@kernel.org>
To: david@fromorbit.com, djwong@kernel.org
Cc: Dave Chinner <dchinner@redhat.com>, linux-xfs@vger.kernel.org
Subject: [PATCHSET v2 0/4] xfs: inodegc fixes for 6.4-rc1
Date: Mon, 01 May 2023 11:27:19 -0700 [thread overview]
Message-ID: <168296563922.290156.2222659364666118889.stgit@frogsfrogsfrogs> (raw)
Hi all,
This series fixes some assorted bugs in the inodegc code that have been
lurking for a while.
The first is that inodes that are ready to be inactivated are put on
per-cpu lockless lists and a per-cpu worker is scheduled to clear that
list eventually. Unfortunately, WORK_CPU_UNBOUND doesn't guarantee that
a worker will actually be scheduled on that CPU, so we need to force
this by specifying the CPU explicitly.
The second problem is that that xfs_inodegc_stop races with other
threads that are trying to add inodes to the percpu list and schedule
the inodegc workers. The solution here is to drain the inodegc lists
by scheduling workers immediately, flushing the workqueue, and
scheduling if any new inodes have appeared.
We also disable the broken fscounters usage of inodegc_stop by neutering
the whole scrubber for now because the proper fixes for it are in the
next batch of online repair patches for 6.5, and the code is still
marked experimental.
v2: document the new locking requirements of xfs_inodegc_{start,stop}
and why we cannot use drain_workqueue
If you're going to start using this mess, you probably ought to just
pull from my git trees, which are linked below.
This is an extraordinary way to destroy everything. Enjoy!
Comments and questions are, as always, welcome.
--D
kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=inodegc-fixes-6.4
---
fs/xfs/scrub/common.c | 26 --------------------------
fs/xfs/scrub/common.h | 2 --
fs/xfs/scrub/fscounters.c | 13 ++++++-------
fs/xfs/scrub/scrub.c | 2 --
fs/xfs/scrub/scrub.h | 1 -
fs/xfs/scrub/trace.h | 1 -
fs/xfs/xfs_icache.c | 40 +++++++++++++++++++++++++++++++++-------
fs/xfs/xfs_mount.h | 3 +++
fs/xfs/xfs_super.c | 3 +++
9 files changed, 45 insertions(+), 46 deletions(-)
next reply other threads:[~2023-05-01 18:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-01 18:27 Darrick J. Wong [this message]
2023-05-01 18:27 ` [PATCH 1/4] xfs: explicitly specify cpu when forcing inodegc delayed work to run immediately Darrick J. Wong
2023-05-01 18:27 ` [PATCH 2/4] xfs: check that per-cpu inodegc workers actually run on that cpu Darrick J. Wong
2023-05-01 18:27 ` [PATCH 3/4] xfs: disable reaping in fscounters scrub Darrick J. Wong
2023-05-01 18:27 ` [PATCH 4/4] xfs: fix xfs_inodegc_stop racing with mod_delayed_work Darrick J. Wong
2023-05-01 23:10 ` Dave Chinner
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=168296563922.290156.2222659364666118889.stgit@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=david@fromorbit.com \
--cc=dchinner@redhat.com \
--cc=linux-xfs@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).