Re: [PATCH v2 2/7] liveupdate: Make failed retrieves distinguishable from dropped files

From: Mike Rapoport

Date: Sun Nov 29 2026 - 15:13:48 EST


Hi Chris,

On Sat, Nov 28, 2026 at 10:27:33AM -0800, Chris Down wrote:
>
> Subject: [PATCH v2 2/7] liveupdate: Make failed retrieves distinguishable from dropped files

IMHO the subject should mention sysfs as it's the major user visible change
here. Another comment about it below.

> At Meta, we want to use live update to upgrade hypervisors in place and
> preserve service fd stores across systemctl kexec. Our kernel rollout
> stops automatically when host health checks fail.
>
> We need it to stop if the new kernel can't give back state that a VMM or
> service handed over. We also want to track files that userspace never
> asks for.

We are not as strict as x86 about the imperative mood, but still it's
preferable :)

> Today the process that tries a retrieve sees its error, but a fleet
> collector can't see that error or tell whether a session went unclaimed.
> Opening /dev/liveupdate to check would itself trigger deserialisation on
> the first open and can get in the way of the real restorer because the
> device is exclusive-open. The collector polls procfs and sysfs, so it
> needs a result it can read after the event.
>
> Let's expose the incoming deserialisation state and aggregate session
> and file counts under /sys/class/misc/liveupdate/incoming/. A collector
> can stop the rollout on state=failed or files_failed > 0, and track
> files that were dropped or are still held. The session owner already
> knows which VM or service it belongs to, so there is no need to expose
> session names.
>
> Signed-off-by: Chris Down <chris@xxxxxxxxxxxxxx>
> ---
> .../ABI/testing/sysfs-class-misc-liveupdate | 44 ++++++++++++++++
> Documentation/userspace-api/liveupdate.rst | 7 +++
> MAINTAINERS | 1 +
> kernel/liveupdate/luo_core.c | 50 +++++++++++++++++++
> kernel/liveupdate/luo_file.c | 16 +++++-
> kernel/liveupdate/luo_internal.h | 34 +++++++++++++
> kernel/liveupdate/luo_session.c | 6 +++
> 7 files changed, 156 insertions(+), 2 deletions(-)
> create mode 100644 Documentation/ABI/testing/sysfs-class-misc-liveupdate
>
> diff --git a/Documentation/ABI/testing/sysfs-class-misc-liveupdate b/Documentation/ABI/testing/sysfs-class-misc-liveupdate
> new file mode 100644
> index 000000000000..25e3b49d7aeb
> --- /dev/null
> +++ b/Documentation/ABI/testing/sysfs-class-misc-liveupdate
> @@ -0,0 +1,44 @@
> +What: /sys/class/misc/liveupdate/incoming/

I wonder if we want to link this from /sys/kernel/liveupdate or that would
be too much?

> +Date: Nov 2026
> +Contact: kexec@xxxxxxxxxxxxxxxxxxx
> +Description:
> + Incoming Live Update Orchestrator (LUO) state and counters.
> + Present when live update is enabled. Each attribute is read
> + independently.
> +Users: system monitoring
> +
> +What: /sys/class/misc/liveupdate/incoming/state
> +Date: Nov 2026
> +Contact: kexec@xxxxxxxxxxxxxxxxxxx
> +Description: read only
> + Status of incoming LUO sessions:
> +
> + "none" No sessions were handed over.
> + "pending" Deserialization has not finished. It
> + starts on the first open of /dev/liveupdate.
> + "deserialized" The sessions can be retrieved.
> + "failed" Deserialization failed. Opening
> + /dev/liveupdate returns -EIO.
> +Users: system monitoring

I'd suggest splitting this into two patches: the first would add sysfs
plumbing and /state and the second would add the counters.

Than it will be easier to bikeshed about sysfs layout, attribute names :)

> +
> +What: /sys/class/misc/liveupdate/incoming/sessions
> +What: /sys/class/misc/liveupdate/incoming/files

For instance, I suspect that 'sessions' and 'files' would grow new attrs,
so maybe it's worth giving each a directory?

Even though is more of boilerplate for a little value today, we'd avoid
multiple file_<attr> and session_<attr> later.

> +Date: Nov 2026
> +Contact: kexec@xxxxxxxxxxxxxxxxxxx
> +Description: read only
> + Number of sessions deserialized and number of files in
> + those sessions, respectively. Counts can be partial while
> + state is "pending" or after it changes to "failed".
> +Users: system monitoring
> +
> +What: /sys/class/misc/liveupdate/incoming/files_retrieved
> +What: /sys/class/misc/liveupdate/incoming/files_failed
> +What: /sys/class/misc/liveupdate/incoming/files_dropped

And these would be

/sys/class/misc/liveupdate/incoming/files/count
/sys/class/misc/liveupdate/incoming/files/retrieved
/sys/class/misc/liveupdate/incoming/files/failed
/sys/class/misc/liveupdate/incoming/files/dropped

and we also could easily add

/sys/class/misc/liveupdate/incoming/sessions/files_count

sometime later.

> +Date: Nov 2026
> +Contact: kexec@xxxxxxxxxxxxxxxxxxx
> +Description: read only
> + Number of successful retrieves, permanent retrieve failures,
> + and files discarded at session finish without a recorded
> + retrieve outcome, respectively. Retrieves and failures are
> + counted when they occur.
> +Users: system monitoring
> diff --git a/Documentation/userspace-api/liveupdate.rst b/Documentation/userspace-api/liveupdate.rst
> index cdd74627ab75..39bbb91d0dd4 100644
> --- a/Documentation/userspace-api/liveupdate.rst
> +++ b/Documentation/userspace-api/liveupdate.rst
> @@ -45,6 +45,13 @@ For details, see:
> - `sd_pid_notify_with_fds(3)
> <https://www.freedesktop.org/software/systemd/man/latest/sd_pid_notify_with_fds.html>`_
>
> +Monitoring
> +==========
> +
> +Read ``/sys/class/misc/liveupdate/incoming/`` to monitor incoming
> +sessions and file retrievals without opening ``/dev/liveupdate``.

Maybe

``/sys/class/misc/liveupdate/incoming`` allows monitoring of incoming
session and file retrievals without opening ``/dev/liveupdate``.

> +See Documentation/ABI/testing/sysfs-class-misc-liveupdate for the sysfs ABI.
> +
> See Also
> ========

--
Sincerely yours,
Mike.