Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@kernel.org>
To: Chris Down <chris@chrisdown.name>
Cc: Pasha Tatashin <pasha.tatashin@soleen.com>,
	Pratyush Yadav <pratyush@kernel.org>,
	Alexander Graf <graf@amazon.com>,
	Baoquan He <baoquan.he@linux.dev>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	kexec@lists.infradead.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kselftest@vger.kernel.org, kernel-team@meta.com,
	Breno Leitao <leitao@debian.org>,
	sashiko-bot@kernel.org
Subject: Re: [PATCH v2 2/7] liveupdate: Make failed retrieves distinguishable from dropped files
Date: Sun, 29 Nov 2026 22:13:36 +0200	[thread overview]
Message-ID: <awyHcLHeKAYz-8-0@kernel.org> (raw)
In-Reply-To: <796edd4ceaa5cf5a28403dab816c04c47754c4df.1795857773.git.chris@chrisdown.name>

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@chrisdown.name>
> ---
>  .../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@lists.infradead.org
> +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@lists.infradead.org
> +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@lists.infradead.org
> +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@lists.infradead.org
> +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.

  reply	other threads:[~2026-11-29 20:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-28 18:27 [PATCH v2 0/7] kho, liveupdate: KHO/LUO observability Chris Down
2026-11-28 18:27 ` [PATCH v2 1/7] kho: Reclaim the metadata page left reserved after kexec Chris Down
2026-11-28 18:27 ` [PATCH v2 2/7] liveupdate: Make failed retrieves distinguishable from dropped files Chris Down
2026-11-29 20:13   ` Mike Rapoport [this message]
2026-11-28 18:27 ` [PATCH v2 3/7] selftests/liveupdate: Catch incorrect file accounting across kexec Chris Down
2026-11-28 18:27 ` [PATCH v2 4/7] kho: Expose rejected handovers that look like cold boots Chris Down
2026-11-29 21:03   ` Mike Rapoport
2026-11-28 18:27 ` [PATCH v2 5/7] kho: Report how much handover memory is preserved and restored Chris Down
2026-11-28 18:27 ` [PATCH v2 6/7] liveupdate: Expose the sequence number for consecutive live updates Chris Down
2026-11-28 18:27 ` [PATCH v2 7/7] selftests/liveupdate: Check handover revival, sequence and memory stats Chris Down

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=awyHcLHeKAYz-8-0@kernel.org \
    --to=rppt@kernel.org \
    --cc=baoquan.he@linux.dev \
    --cc=chris@chrisdown.name \
    --cc=corbet@lwn.net \
    --cc=graf@amazon.com \
    --cc=kernel-team@meta.com \
    --cc=kexec@lists.infradead.org \
    --cc=leitao@debian.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pasha.tatashin@soleen.com \
    --cc=pratyush@kernel.org \
    --cc=sashiko-bot@kernel.org \
    --cc=skhan@linuxfoundation.org \
    /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