From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795983224; b=32vNnj2cl8T1746BUNCF4pEhwOrWa4MxR6tI+sfRaNszX2pejmAVeePdi8spC/Rl43LU dfWbNSuNkxPldMf0ic5HWmpCPS2/oWsHWdLITdZVrDealK621rZBUoZwKMqXrCapjcqOv ZQEKXMMJM+X+RnmR0mi8LKBTUQrV1W2hUe8cnh+JBvz6BwUgIUNduuiXB7V7iFSnkL5Gk vOdB2Bd0a9n3kaLxGdUho9udWG62YCmuRRw1adE9G1FghIuu9y1znN44a7IcdKx/0B5JW 5fTV8UntEbuRpBMssE2FF3MVBGk1SE6LHKZw+FnYRYAhbs+9iq+0r3zuO85rLseED4w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795983224; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=IqZipUyOqAxmX1kkUO3kYS5em3ruxl0VhpgQQBp7VuE=; b=DmpaJiTflgtxFjQ3X2MWWUsD8iA9I5atTGjHkYtqH9ZlgYxInn0LvjfieM/U5yNqBzAt /LrMijy4YQbims/v6MA3z1FOwXx8CzJbrbTHf2BSoEOrECduQOk2eYfSP6CgqB57aaohf f5HgGsVB0nfDDnowXVWdbkwFYcMG2M5s+uHpYQmj5zzCCh7c5rTFCjydNCGaMyYn9t7xc 8UHgTgvnKk0XxckTjDKWTZqTNPV2dGJDwl2lpRbfU5jdFdApC2ceubc5WTA016kTjf+pK YZnEiBx7cLAixzVFvJh5nUcrYCbNon32gw+ryuTZDfpHibxkhrRvO8IqhVEhCB6Sasw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=awElyuql; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7595C606A31C; Sun, 29 Nov 2026 20:13:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=awElyuql Received: by smtp.kernel.org (Postfix) with ESMTPSA id C52531F000C1; Sun, 29 Nov 2026 20:13:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795983224; bh=IqZipUyOqAxmX1kkUO3kYS5em3ruxl0VhpgQQBp7VuE=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=awElyuqlSKilI9kUmpY00LHjZlcv9MA/9da+9AvCnXWONus6aOInXhikrYZYn0Ih4 pbn1BlJmBTA5Jm/hh4cYm3uKMGywkySzaedrad8ENN9+B3yifseGIUnnKZzsTSTJyw 1C9PjfutFg1s8Z/mEPVqKIFTbJBMethFVdGyg3CGnIxMrzQ5QOBOIvvgBbccaPv84o EDg9pLo5B2voJYGIBNDf58kKlUM0eY+aZUsJfrG13cHArSWlfQkhEkmktlUk94++om yvqVLw0w7PfSFPzBeY1VMUtfVnFRNIydtk54q6jzeZAnMRQ3Ma6ZeFQuruOAhssJGv MJDmRmG/7TVGA== Date: Sun, 29 Nov 2026 22:13:36 +0200 From: Mike Rapoport To: Chris Down Cc: Pasha Tatashin , Pratyush Yadav , Alexander Graf , Baoquan He , Jonathan Corbet , Shuah Khan , 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 , sashiko-bot@kernel.org Subject: Re: [PATCH v2 2/7] liveupdate: Make failed retrieves distinguishable from dropped files Message-ID: References: <796edd4ceaa5cf5a28403dab816c04c47754c4df.1795857773.git.chris@chrisdown.name> X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 > --- > .../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_ and session_ 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) > `_ > > +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.