linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luis Chamberlain <mcgrof@kernel.org>
To: rafael@kernel.org, gregkh@linuxfoundation.org,
	viro@zeniv.linux.org.uk, jack@suse.cz, bvanassche@acm.org,
	jeyu@kernel.org, ebiederm@xmission.com
Cc: mchehab@kernel.org, keescook@chromium.org,
	linux-fsdevel@vger.kernel.org, kernel@tuxforce.de,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	Luis Chamberlain <mcgrof@kernel.org>
Subject: [RFC v2 0/6] vfs: provide automatic kernel freeze / resume
Date: Sat, 17 Apr 2021 00:10:20 +0000	[thread overview]
Message-ID: <20210417001026.23858-1-mcgrof@kernel.org> (raw)

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


             reply	other threads:[~2021-04-17  0:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-17  0:10 Luis Chamberlain [this message]
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
2023-01-10  2:11       ` Luis Chamberlain

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=20210417001026.23858-1-mcgrof@kernel.org \
    --to=mcgrof@kernel.org \
    --cc=bvanassche@acm.org \
    --cc=ebiederm@xmission.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jack@suse.cz \
    --cc=jeyu@kernel.org \
    --cc=keescook@chromium.org \
    --cc=kernel@tuxforce.de \
    --cc=kexec@lists.infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=rafael@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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).