[PATCH v4 0/3] liveupdate: Add LIVEUPDATE_SESSION_FREEZE ioctl
Pasha Tatashin
pasha.tatashin at soleen.com
Sun Oct 25 18:49:43 PDT 2026
Currently, LUO sessions are frozen automatically only inside the
reboot(LINUX_REBOOT_CMD_KEXEC) path, where luo_session_serialize()
iterates through all outgoing sessions under global write locks and
freezes them serially during shutdown.
This series introduces the LIVEUPDATE_SESSION_FREEZE ioctl on session
file descriptors so userspace can freeze a session as soon as it is done
with it, rather than delaying until auto-freeze at kexec time. Because
luo_session_freeze() only acquires the per-session mutex, userspace can
also freeze multiple sessions concurrently in advance, reducing kexec
blackout time.
Once frozen, no further files can be preserved in the session and
subsequent freeze attempts return -EBUSY (or -EINVAL on incoming
sessions). During kexec, already-frozen sessions skip the late
auto-freeze step; if an early-frozen session is closed before kexec, its
files are rolled back via .unfreeze() before being unpreserved.
This series is based on liveupdate/next commit 27be83a12b24 ("Merge
branch 'lu-pci-preservation' into next").
Changelog:
v4:
- Split out a preparatory patch that drops struct luo_file_set_ser *
from luo_file_freeze() / luo_file_unfreeze() and moves file_set_ser
handling into luo_session_serialize_one() /
luo_session_unserialize_one() (Suggested by Mike Rapoport).
- Few more nits from Mike.
v3:
- Renamed session->frozen to session->user_frozen, - Pratyush
- Added Reviewed-by's
v2:
- Rebased onto liveupdate/next (commit 27be83a12b24 ("Merge branch
'lu-pci-preservation' into next")) and split out early session freeze
into a standalone series (tmpfs preservation and its per-file user
argument plumbing were spun out into a separate series).
- Patch 1:
- Drop struct luo_file_set_ser * from luo_file_freeze() and
luo_file_unfreeze(), and rename the session helpers to
luo_session_serialize_one() / luo_session_unserialize_one() so all
of struct luo_session_ser is populated and cleared in one place
(Suggested by Pratyush Yadav).
- Unfreeze the session's files if luo_ucmd_respond() fails in
luo_session_freeze().
- Update remaining reboot-only wording in luo_file.c kernel-doc
comments.
- Patch 2:
- Add checks verifying that non-zero reserved bits and freezing an
incoming post-kexec session fail with -EINVAL.
Link: https://lore.kernel.org/all/20261015093816.2438942-1-pasha.tatashin@soleen.com/ # v1
Pasha Tatashin (3):
liveupdate: Move file_set_ser handling to session serialization
helpers
liveupdate: Add LIVEUPDATE_SESSION_FREEZE ioctl to freeze sessions
early
selftests: liveupdate: Add tests for LIVEUPDATE_SESSION_FREEZE
include/linux/liveupdate.h | 3 +-
include/uapi/linux/liveupdate.h | 25 ++++++
kernel/liveupdate/luo_file.c | 73 +++++++---------
kernel/liveupdate/luo_internal.h | 9 +-
kernel/liveupdate/luo_session.c | 87 +++++++++++++++----
mm/memfd_luo.c | 5 +-
.../liveupdate/lib/include/libliveupdate.h | 1 +
.../selftests/liveupdate/lib/lu_utils.c | 10 +++
.../testing/selftests/liveupdate/liveupdate.c | 45 ++++++++++
.../selftests/liveupdate/luo_kexec_simple.c | 8 ++
10 files changed, 203 insertions(+), 63 deletions(-)
--
2.56.0.307.g5fe7bd680c-goog
More information about the kexec
mailing list