Linux-Fsdevel Archive on lore.kernel.org
 help / color / Atom feed
* [RFC v2 0/6] vfs: provide automatic kernel freeze / resume
@ 2021-04-17  0:10 Luis Chamberlain
  2021-04-17  0:10 ` [RFC v2 1/6] fs: provide unlocked helper for freeze_super() Luis Chamberlain
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Luis Chamberlain @ 2021-04-17  0:10 UTC (permalink / raw)
  To: rafael, gregkh, viro, jack, bvanassche, jeyu, ebiederm
  Cc: mchehab, keescook, linux-fsdevel, kernel, kexec, linux-kernel,
	Luis Chamberlain

This picks up where I left off in 2017, I was inclined to respin this
up again due to a new issue Lukas reported which is easy to reproduce.
I posted a stop-gap patch for that issue [0] and a test case, however,
*this* is the work we want upstream to fix these sorts of issues.

As discussed long ago though at LSFMM, we have much work to do. However,
we can take small strides to get us closer. This is trying to take one
step. It addresses most of the comments and feedback from the last
series I posted, however it doesn't address the biggest two issues:

 o provide clean and clear semantics between userspace ioctls /
   automatic fs freeze, and freeze bdev. This also involves moving the
   counter stuff from bdev to the superblock. This is pending work.
 o The loopback hack which breaks the reverse ordering isn't addressed,
   perhaps just flagging it suffices for now?
 o The long term desirable DAG *is* plausable and I have an initial
   kernel graph implementation which I could use, but that may take
   longer to merge.

What this series *does* address based on the last series is:

  o Rebased onto linux-next tag next-20210415
  o Fixed RCU complaints. The issue was that I was adding new fs levels, and
    this increated undesirably also the amount of rw semaphores, but we were
    just using the new levels to distinguish *who* was triggering the suspend,
    it was either inside the kernel and automatic, or triggered by userspace.
  o thaw_super_locked() was added but that unlocks the sb sb->s_umount,
    our exclusive reverse iterate supers however will want to hold that
    semaphore, so we provide a helper which lets the caller do the unlocking
    for you, and make thaw_super_locked() a user of that.
  o WQ_FREEZABLE is now dealt with
  o I have folded the fs freezer removal stuff into the patch which adds
    the automatic fs frezer / thaw work from the kernel as otherwise separting
    this would create intermediate steps which would produce kernels which
    can stall on suspend / resume.

[0] https://lkml.kernel.org/r/20210416235850.23690-1-mcgrof@kernel.org
[1] https://lkml.kernel.org/r/20171129232356.28296-1-mcgrof@kernel.org              

Luis Chamberlain (6):
  fs: provide unlocked helper for freeze_super()
  fs: add frozen sb state helpers
  fs: add a helper for thaw_super_locked() which does not unlock
  fs: distinguish between user initiated freeze and kernel initiated
    freeze
  fs: add iterate_supers_excl() and iterate_supers_reverse_excl()
  fs: add automatic kernel fs freeze / thaw and remove kthread freezing

 fs/btrfs/disk-io.c     |   4 +-
 fs/btrfs/scrub.c       |   2 +-
 fs/cifs/cifsfs.c       |  10 +-
 fs/cifs/dfs_cache.c    |   2 +-
 fs/ext4/ext4_jbd2.c    |   2 +-
 fs/ext4/super.c        |   2 -
 fs/f2fs/gc.c           |   7 +-
 fs/f2fs/segment.c      |   6 +-
 fs/gfs2/glock.c        |   6 +-
 fs/gfs2/main.c         |   4 +-
 fs/jfs/jfs_logmgr.c    |  11 +-
 fs/jfs/jfs_txnmgr.c    |  31 ++--
 fs/nilfs2/segment.c    |  48 +++---
 fs/super.c             | 321 ++++++++++++++++++++++++++++++++++-------
 fs/xfs/xfs_log.c       |   3 +-
 fs/xfs/xfs_mru_cache.c |   2 +-
 fs/xfs/xfs_pwork.c     |   2 +-
 fs/xfs/xfs_super.c     |  14 +-
 fs/xfs/xfs_trans.c     |   3 +-
 fs/xfs/xfs_trans_ail.c |   7 +-
 include/linux/fs.h     |  64 +++++++-
 kernel/power/process.c |  15 +-
 22 files changed, 405 insertions(+), 161 deletions(-)

-- 
2.29.2


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, back to index

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-17  0:10 [RFC v2 0/6] vfs: provide automatic kernel freeze / resume Luis Chamberlain
2021-04-17  0:10 ` [RFC v2 1/6] fs: provide unlocked helper for freeze_super() Luis Chamberlain
2021-04-20 12:03   ` Christoph Hellwig
2021-04-17  0:10 ` [RFC v2 2/6] fs: add frozen sb state helpers Luis Chamberlain
2021-04-17  0:10 ` [RFC v2 3/6] fs: add a helper for thaw_super_locked() which does not unlock Luis Chamberlain
2021-04-17  0:10 ` [RFC v2 4/6] fs: distinguish between user initiated freeze and kernel initiated freeze Luis Chamberlain
2021-04-20 12:46   ` Christoph Hellwig
2021-04-17  0:10 ` [RFC v2 5/6] fs: add iterate_supers_excl() and iterate_supers_reverse_excl() Luis Chamberlain
2021-04-17  0:10 ` [RFC v2 6/6] fs: add automatic kernel fs freeze / thaw and remove kthread freezing Luis Chamberlain
2021-04-20 12:59   ` Christoph Hellwig
2021-04-20 18:47     ` Luis Chamberlain

Linux-Fsdevel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-fsdevel/0 linux-fsdevel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-fsdevel linux-fsdevel/ https://lore.kernel.org/linux-fsdevel \
		linux-fsdevel@vger.kernel.org
	public-inbox-index linux-fsdevel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-fsdevel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git