[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250402-work-freeze-v2-0-6719a97b52ac@kernel.org>
Date: Wed, 2 Apr 2025 16:07:30 +0200
From: Christian Brauner <brauner@...nel.org>
To: linux-fsdevel@...r.kernel.org,
jack@...e.cz
Cc: Christian Brauner <brauner@...nel.org>,
Ard Biesheuvel <ardb@...nel.org>,
linux-efi@...r.kernel.org,
linux-kernel@...r.kernel.org,
James Bottomley <James.Bottomley@...senpartnership.com>,
mcgrof@...nel.org,
hch@...radead.org,
david@...morbit.com,
rafael@...nel.org,
djwong@...nel.org,
pavel@...nel.org,
peterz@...radead.org,
mingo@...hat.com,
will@...nel.org,
boqun.feng@...il.com
Subject: [PATCH v2 0/4] power: wire-up filesystem freeze/thaw with suspend/resume
Now all the pieces are in place to actually allow the power subsystem to
freeze/thaw filesystems during suspend/resume. Filesystems are only
frozen and thawed if the power subsystem does actually own the freeze.
Othwerwise it risks thawing filesystems it didn't own. This could be
done differently be e.g., keeping the filesystems that were actually
frozen on a list and then unfreezing them from that list. This is
disgustingly unclean though and reeks of an ugly hack.
If the filesystem is already frozen by the time we've frozen all
userspace processes we don't care to freeze it again. That's userspace's
job once the process resumes. We only actually freeze filesystems if we
absolutely have to and we ignore other failures to freeze.
We could bubble up errors and fail suspend/resume if the error isn't
EBUSY (aka it's already frozen) but I don't think that this is worth it.
Filesystem freezing during suspend/resume is best-effort. If the user
has 500 ext4 filesystems mounted and 4 fail to freeze for whatever
reason then we simply skip them.
What we have now is already a big improvement and let's see how we fare
with it before making our lives even harder (and uglier) than we have
to.
Signed-off-by: Christian Brauner <brauner@...nel.org>
---
Changes in v2:
- Drop all patches that remove TASK_FREEZABLE.
- Expand commit messages a bit.
- Link to v1: https://lore.kernel.org/r/20250401-work-freeze-v1-0-d000611d4ab0@kernel.org
---
Christian Brauner (4):
fs: add owner of freeze/thaw
fs: allow all writers to be frozen
power: freeze filesystems during suspend/resume
kernfs: add warning about implementing freeze/thaw
fs/f2fs/gc.c | 6 ++--
fs/gfs2/super.c | 20 ++++++-----
fs/gfs2/sys.c | 4 +--
fs/ioctl.c | 8 ++---
fs/kernfs/mount.c | 15 +++++++++
fs/super.c | 82 ++++++++++++++++++++++++++++++++++++---------
fs/xfs/scrub/fscounters.c | 4 +--
fs/xfs/xfs_notify_failure.c | 6 ++--
include/linux/fs.h | 16 +++++----
kernel/power/hibernate.c | 16 ++++++++-
kernel/power/main.c | 31 +++++++++++++++++
kernel/power/power.h | 4 +++
kernel/power/suspend.c | 7 ++++
13 files changed, 174 insertions(+), 45 deletions(-)
---
base-commit: 62dfd8d59e2d16873398ede5b1835e302df789b3
change-id: 20250401-work-freeze-693b5b5a78e0
Powered by blists - more mailing lists