From: Chris Down <chris@chrisdown.name>
To: Pasha Tatashin <pasha.tatashin@soleen.com>,
Mike Rapoport <rppt@kernel.org>,
Pratyush Yadav <pratyush@kernel.org>
Cc: 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: [PATCH v2 6/7] liveupdate: Expose the sequence number for consecutive live updates
Date: Sat, 28 Nov 2026 10:27:42 -0800 [thread overview]
Message-ID: <3a8fbe6a8642b038635df1975ec4b77094049d64.1795857773.git.chris@chrisdown.name> (raw)
In-Reply-To: <cover.1795857773.git.chris@chrisdown.name>
Export LUO's live update sequence number, so that fleet monitoring can
compare hosts on their first live update with hosts that have been
through several.
We want this because some bugs, like memory corruption, may only show up
after several live updates in a row.
Signed-off-by: Chris Down <chris@chrisdown.name>
---
Documentation/ABI/testing/sysfs-class-misc-liveupdate | 9 +++++++++
Documentation/userspace-api/liveupdate.rst | 1 +
kernel/liveupdate/luo_core.c | 8 ++++++++
3 files changed, 18 insertions(+)
diff --git a/Documentation/ABI/testing/sysfs-class-misc-liveupdate b/Documentation/ABI/testing/sysfs-class-misc-liveupdate
index 8c3814ee3d37..023961a42b29 100644
--- a/Documentation/ABI/testing/sysfs-class-misc-liveupdate
+++ b/Documentation/ABI/testing/sysfs-class-misc-liveupdate
@@ -24,6 +24,15 @@ Description: read only
the underlying KHO handover.
Users: system monitoring
+What: /sys/class/misc/liveupdate/incoming/liveupdate_num
+Date: Nov 2026
+Contact: kexec@lists.infradead.org
+Description: read only
+ LUO sequence number passed by the previous kernel. Reads 0
+ if no LUO state was handed over, 1 after the first live
+ update in a sequence, and increments with each update.
+Users: system monitoring
+
What: /sys/class/misc/liveupdate/incoming/sessions
What: /sys/class/misc/liveupdate/incoming/files
Date: Nov 2026
diff --git a/Documentation/userspace-api/liveupdate.rst b/Documentation/userspace-api/liveupdate.rst
index 39bbb91d0dd4..61c246371200 100644
--- a/Documentation/userspace-api/liveupdate.rst
+++ b/Documentation/userspace-api/liveupdate.rst
@@ -50,6 +50,7 @@ Monitoring
Read ``/sys/class/misc/liveupdate/incoming/`` to monitor incoming
sessions and file retrievals without opening ``/dev/liveupdate``.
+``liveupdate_num`` gives the LUO sequence number for the current boot.
See Documentation/ABI/testing/sysfs-class-misc-liveupdate for the sysfs ABI.
See Also
diff --git a/kernel/liveupdate/luo_core.c b/kernel/liveupdate/luo_core.c
index ba174e9aae03..3ca7b3875247 100644
--- a/kernel/liveupdate/luo_core.c
+++ b/kernel/liveupdate/luo_core.c
@@ -441,6 +441,13 @@ static ssize_t state_show(struct device *dev, struct device_attribute *attr,
}
static DEVICE_ATTR_RO(state);
+static ssize_t liveupdate_num_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ return sysfs_emit(buf, "%llu\n", luo_global.liveupdate_num);
+}
+static DEVICE_ATTR_RO(liveupdate_num);
+
#define LUO_INCOMING_ATTR_RO(_name) \
static ssize_t _name##_show(struct device *dev, \
struct device_attribute *attr, char *buf) \
@@ -458,6 +465,7 @@ LUO_INCOMING_ATTR_RO(files_dropped);
static struct attribute *luo_incoming_attrs[] = {
&dev_attr_state.attr,
+ &dev_attr_liveupdate_num.attr,
&dev_attr_sessions.attr,
&dev_attr_files.attr,
&dev_attr_files_retrieved.attr,
--
2.56.1
next prev parent reply other threads:[~2026-11-28 18:27 UTC|newest]
Thread overview: 8+ 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-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-28 18:27 ` [PATCH v2 5/7] kho: Report how much handover memory is preserved and restored Chris Down
2026-11-28 18:27 ` Chris Down [this message]
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=3a8fbe6a8642b038635df1975ec4b77094049d64.1795857773.git.chris@chrisdown.name \
--to=chris@chrisdown.name \
--cc=baoquan.he@linux.dev \
--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=rppt@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
all inboxes | Powered by JetHome®