From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0ED95606A325 for ; Sun, 29 Nov 2026 20:13:50 +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 kanga.kvack.org (Postfix) id 049656B05B0; Sun, 29 Nov 2026 15:13:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F3C3C6B05B3; Sun, 29 Nov 2026 15:13:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E52B76B05B4; Sun, 29 Nov 2026 15:13:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id BD90C6B05B0 for ; Sun, 29 Nov 2026 15:13:48 -0500 (EST) Received: from smtpin22.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay10.hostedemail.com (Postfix) with ESMTP id C231EC0917 for ; Sun, 29 Nov 2026 20:13:47 +0000 (UTC) X-FDA: 85489257294.22.7DD2608 Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by imf27.hostedemail.com (Postfix) with ESMTP id 0E90640006 for ; Sun, 29 Nov 2026 20:13:45 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=awElyuql; spf=pass (imf27.hostedemail.com: domain of rppt@kernel.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1795983226; b=49fhcB/xz1SvIY6LAP6biVXxtZH8RCg818Fuf/d2RF1MGNvenyzTUd8GRAaslmvwxlhkKM 10aHkXqPnf0bWjFDt/J0mLqSnlvI82IDHcVUKxQrc7/W3n+JdGCPkQ1XxFOacvO+YuvSBy CIX7LkmC2KRRz3DeW26YteNg5iadRF8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1795983226; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=IqZipUyOqAxmX1kkUO3kYS5em3ruxl0VhpgQQBp7VuE=; b=dDfJGvuFjv+6n8G6iDPFlHlyIjzbos7EoszYvi3giASeGJyhHbCjce2JK6siXQe6ntiRoJ YZW1/MQdLJTXS40wJDg46BE4VzufdpnMFOzhmisJaoK9RxCWxGeOB21TipW9NqRbRPRuP6 hsOpds4hX9/fA8yw3ikAoYc8ovyZTjA= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=awElyuql; spf=pass (imf27.hostedemail.com: domain of rppt@kernel.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org 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-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 0E90640006 X-Rspam-User: X-Stat-Signature: p1pud4bp3z5grjaebpejxxaccz6z43q8 X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 X-HE-Tag: 1795983225-445610 X-HE-Meta: U2FsdGVkX18jDdYUNfYkSft6B9Zksdg4aots2dIJJt2iU8nuuhJWCw52b4Q+XUR+Gqjc9en9E/NcOCqIPW8pxG/8p3GE7Lzy2HevN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WK3NaSCSs23bm9s9Hg6WofCZSQQzMCZtjRUhAFg3U0Jhlhm4nXzRcq5dC8JMeqJ1rdtXGAbBJPKzUR+XPURCjGgjke8356cyZpPhn6BwziKpan7JdxAQBN9TuiYqX1EjFa/KeA3x0S+coGkr49EqNGgk1W8y36gkOrnp8ubitzoDahPw0PVFbcxD17zg6UmMOn/puZneO2IHo2xGAD/sakELHxdpXiABikaMVW0KgxKJx530RoFZSvZK7JAustvDVCnH5UeArEF5lc9JQyr/ub6vfPWDAEy02BOTROVJ7OAnzM1YKz8MA4rvB2cSI1irIITdHIBdXQoGm3zFFxfM6gWimEGACs/ih91GG3qcW6dd7Gde3d/0ERpzCqAo3mFyXb6Kljc0ePBj70/MSh+Y9CmUs+W+c9zJ11tUvDuTyi6oNQzNvdZyJppKX5Yhd87by8f5cTpcJIJWB8GQ6UHr0BWQ== Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: 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.