Skip to content

RFC fs: automatic kernel fs freeze / thaw

Luis Chamberlain linux-fsdevel lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest6 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6fs: add frozen sb state helpersfs/ext4/ext4_jbd2.c fs/gfs2/sys.c fs/quota/quota.c +3 more+31 -90 replies
2/6fs: add iterate_supers_excl() and iterate_supers_reverse_excl()fs/super.c include/linux/fs.h+93 -01 reply
3/6fs: add automatic kernel fs freeze / thaw and remove kthread freezingfs/super.c include/linux/fs.h kernel/power/process.c+78 -13 replies
4/6ext4: replace kthread freezing with auto fs freezingfs/ext4/mballoc.c fs/ext4/super.c+4 -71 reply
5/6btrfs: replace kthread freezing with auto fs freezingfs/btrfs/disk-io.c fs/btrfs/scrub.c fs/btrfs/super.c+4 -40 replies
6/6xfs: replace kthread freezing with auto fs freezingfs/xfs/xfs_discard.c fs/xfs/xfs_log.c fs/xfs/xfs_log_cil.c +5 more+13 -190 replies

Reviews trailers per patch

3 of 6 patches have a Reviewed-by or Acked-by.

PatchJan Kara
1/6R-b
2/6R-b
3/6R-b
4/6
5/6
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC 0/6] fs: automatic kernel fs freeze / thaw

Based on discussions at LSFMM, on where are we at with automatic fs suspend / resume. I did a quick check and most of the complexities from the last series I tried from 2023-03 [0] are now resolved, namely the following patches are no longer needed as Christian did the work for this already:

fs: unify locking semantics for fs freeze / thaw
fs: distinguish between user initiated freeze and kernel initiated freeze
fs: move !SB_BORN check early on freeze and add for thaw

So the only thing left to do is add an fs flag for a sanity check that the fs doesn't use rely on ktrhead freezing, and enable it for filesystems which have done that work. This adds the work for a few filesystems. If regressions are found we can simply remove FS_AUTOFREEZE from the fs.

I did a quick boot test with this on my laptop and suspend doesn't work, its not clear if this was an artifact of me trying this on linux-next or what, I can try without my patches on next to see if next actually suspends without them. And so, we gotta figure out if there's something stupid still to fix, or something broken with these changes I overlooked on the rebase.

[0] https://web.git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git/log/?h=20230507-fs-freeze

Luis Chamberlain (6):
fs: add frozen sb state helpers
fs: add iterate_supers_excl() and iterate_supers_reverse_excl()
fs: add automatic kernel fs freeze / thaw and remove kthread freezing
ext4: replace kthread freezing with auto fs freezing
btrfs: replace kthread freezing with auto fs freezing
xfs: replace kthread freezing with auto fs freezing

 fs/btrfs/disk-io.c     |   4 +-
 fs/btrfs/scrub.c       |   2 +-
 fs/btrfs/super.c       |   2 +-
 fs/ext4/ext4_jbd2.c    |   2 +-
 fs/ext4/mballoc.c      |   2 +-
 fs/ext4/super.c        |   9 +--
 fs/gfs2/sys.c          |   2 +-
 fs/quota/quota.c       |   3 +-
 fs/super.c             | 149 +++++++++++++++++++++++++++++++++++++++--
 fs/xfs/xfs_discard.c   |   2 +-
 fs/xfs/xfs_log.c       |   3 +-
 fs/xfs/xfs_log_cil.c   |   2 +-
 fs/xfs/xfs_mru_cache.c |   2 +-
 fs/xfs/xfs_pwork.c     |   2 +-
 fs/xfs/xfs_super.c     |  16 ++---
 fs/xfs/xfs_trans.c     |   3 +-
 fs/xfs/xfs_trans_ail.c |   3 -
 fs/xfs/xfs_zone_gc.c   |   2 -
 include/linux/fs.h     |  38 +++++++++++
 kernel/power/process.c |  15 ++++-
 20 files changed, 223 insertions(+), 40 deletions(-)
Signature · 1 line
2.47.2