From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CD686606A31C for ; Sun, 29 Nov 2026 20:13:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=aOC1ac2i; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=awElyuql DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=IqZipUyOqAxmX1kkUO3kYS5em3ruxl0VhpgQQBp7VuE=; b=aOC1ac2isgeHHfvT2vgn30J8cl VmgiQe+/KIteOfS6K3CSZng1VBWFgEa6VGcT4yBsorDRxSU+IKgG9FpPIP/hTJuv0tswMiWZ+dYzZ CQeXPce9dwXHSByvOL5vfqDzuc2uX5PjxcaYHSPpZEg75XAQGKlTpotT376txWXwaTFFFzUegWOAl IIrgmVhohPsp4n0cpZomsiucbXwoSId1un9MF+7ATiE3tbNpOWMdik8a0/x8wykasxgLYfq3062dB y3LStNcTryWoQv0+XA7LJkbmcZXwRs2AkqQswzPanyUB78dEdkT8P75HJtsLzmC0PeWCSist0eWV/ xzNdTGrA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xXlHP-00000002Rp1-05l6; Sun, 29 Nov 2026 20:13:47 +0000 Received: from sea.source.kernel.org ([172.234.252.31]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xXlHM-00000002Rov-3uPa for kexec@lists.infradead.org; Sun, 29 Nov 2026 20:13:45 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 5F8AE4169F; Sun, 29 Nov 2026 20:13:44 +0000 (UTC) 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-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <796edd4ceaa5cf5a28403dab816c04c47754c4df.1795857773.git.chris@chrisdown.name> X-BeenThere: kexec@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kexec" X-Spam-Status: No, score=-15.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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.