Message ID | 20250320024011.2995837-1-pasha.tatashin@soleen.com (mailing list archive) |
---|---|
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B856DC35FFC for <linux-mm@archiver.kernel.org>; Thu, 20 Mar 2025 02:40:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 56A32280003; Wed, 19 Mar 2025 22:40:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 51B40280001; Wed, 19 Mar 2025 22:40:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 395F7280003; Wed, 19 Mar 2025 22:40:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 1A216280001 for <linux-mm@kvack.org>; Wed, 19 Mar 2025 22:40:16 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id B6DF41A028E for <linux-mm@kvack.org>; Thu, 20 Mar 2025 02:40:17 +0000 (UTC) X-FDA: 83240375274.09.7134F9D Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) by imf18.hostedemail.com (Postfix) with ESMTP id E8B5F1C000A for <linux-mm@kvack.org>; Thu, 20 Mar 2025 02:40:15 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=soleen-com.20230601.gappssmtp.com header.s=20230601 header.b=Rmtam8Mz; spf=pass (imf18.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.222.180 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com; dmarc=pass (policy=none) header.from=soleen.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1742438416; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=9Oh+wZ0iaEUOZozW+9qtsMspd/PywyTewkvRRfAF3O8=; b=TwvcpTnIg1K9PnTuy+XoYaRqmqjIIs0YV8YIkwwjxKundjGmROvASroamBf1IrintoS5H+ TLzSsEy2odaO7206w8PB+vmcbURb+Ps/Ep1LS/PWL/zWnfyl9OL050ExN7ttkrk4nVahxh IuPO/ERyf5Nyr3CtnWY5dZsH5bmkxSo= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=soleen-com.20230601.gappssmtp.com header.s=20230601 header.b=Rmtam8Mz; spf=pass (imf18.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.222.180 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com; dmarc=pass (policy=none) header.from=soleen.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1742438416; a=rsa-sha256; cv=none; b=JQKJlaH2AwIqbiseNdxYU7VaahevhmxB6GHfEK8CB5MgcnsE06vnhYQreeUhkTwf4IHHcx nJGKFRZRGJYhiXCPYymzF6Az6OHPiHUgGUzXKCtHETNBBJJdPaEE2Ma5hI3oc4WEhUlqAz 4cnJkFfjDK0lbZCs01R4Yfbbnu+qbRI= Received: by mail-qk1-f180.google.com with SMTP id af79cd13be357-7be8f28172dso23953685a.3 for <linux-mm@kvack.org>; Wed, 19 Mar 2025 19:40:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen-com.20230601.gappssmtp.com; s=20230601; t=1742438415; x=1743043215; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=9Oh+wZ0iaEUOZozW+9qtsMspd/PywyTewkvRRfAF3O8=; b=Rmtam8MzkekyF/3lXOGIJYpyyiyo8ApARtPBpE47MhibcXt1qV3xzeqMiCvBNzMZEj BmyO9DPlMUJRhOeVg1kmzIAsPUtXTEF3EmjWJ01kyTSKXx2HRvVKaL0wyIPLsU8VaFbd HDHMFf3QYqhk7B0u1EReRSJ0zquQjz7C2g8vtvRHvKDtJZ+ZK7iNojsOp9gdII6OO0vP xG0Ypm3tJrXBj3xJDidJ60SBDSsfKZ5cPW+u+JKKZE3bk/1w/fngExQKjJYUeHM/yf/Y iBqUSDB/k1MGrFmwC7s6FTDreqiNGfx+MmfIQc3Yl6jt2bzIfsgWOJPqIuD2by9gX6U2 XEfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742438415; x=1743043215; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9Oh+wZ0iaEUOZozW+9qtsMspd/PywyTewkvRRfAF3O8=; b=Grcs7dH825zEoYov5b2J3QmPaYoGMlld5dtm+V6Zs6HogwfvD/Cf3VhmwJuc08AT9W PNvX0iIzOlBymMeNuvxx11MnWWvrmXXeUsW3Gwa/DkCmcckcgUXr1MPBj6HrUMZtq3RN AO7x3TK8YW97N5ir//lOyzPVsJCET0bAVkOd3SzG4nWgJEgiw7bizyp3gFCsSZyuJqSV Ois9W0u/ZtZ7nVgVV8HXuivMjftchoTCTaA4ZXFdJlQHD26s8Fnguxkw1XUI/1rKAxsK 28czzFyQpZ5vZim3APebW7ptbvunNQoW33k5v/IYOUW2gImZuDss7APMAaQql3vzc+3M SV8w== X-Forwarded-Encrypted: i=1; AJvYcCX84aeuR6hxinKiFZnxyM0cg7eq3GihH/e3oOhLS2Robs1GLGnCr2K3I9BJ8NkA+tJzQG8v9B8nzQ==@kvack.org X-Gm-Message-State: AOJu0YyOX0bwSRxF0I+qkVLRYqcdHq7XwDH07PzHRnH4jo+oleQjzz4i iDD2zEFh6q3xt2RHFmG/sB8bZ+r77Jyj9y5eOwRinaD24uJyH/Dz2whVoBbhU/4= X-Gm-Gg: ASbGncujPpaIuLmQx8jdYOH94fl8K4lDRH52ewdndNy+nU0qaPDU9Lxq6nCyN2+23sN 5THursIo+leL4zCDwxkXcKaT+CGEunn5Yac/+03bRmo3r7p7g5c+oakD1HQ7ZH3ws+a7XIq+/wS vYXAwlXbpU1NZWDiSolgFsMC/gmoNPD3hClePeua6/Ou3q+Q+NCELw68JazmX8Yn3ITqAfznvPU IHJ5DGQEA0Rcn2fVQbkuxr+n0uvAqmBLSW/lSOLU6LIG4BJAQk/u9qA1WJabmEFdaxqDaj57anJ LzUAo4fvl/CgheAT4KiM3U1hwxPswAWsYr9jEAPUYNm8cWtj2OmTJjuNOEPwIwp/RFjKFNsVF2f JP+FO9anj8lolefXaF0in/K6gG7yXdquE X-Google-Smtp-Source: AGHT+IGIHM7x9JmjXVe5QvHNWUIW0u0BUMH/A7Ywm/vljWGz/qU956ZjDvvuxrGdrZxMRIAN12ftNA== X-Received: by 2002:a05:620a:4611:b0:7c5:42c8:ac89 with SMTP id af79cd13be357-7c5b0c95cdamr219473385a.33.1742438414916; Wed, 19 Mar 2025 19:40:14 -0700 (PDT) Received: from soleen.c.googlers.com.com (249.60.48.34.bc.googleusercontent.com. [34.48.60.249]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7c573c4dd9fsm947815985a.4.2025.03.19.19.40.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Mar 2025 19:40:14 -0700 (PDT) From: Pasha Tatashin <pasha.tatashin@soleen.com> To: changyuanl@google.com, graf@amazon.com, pasha.tatashin@soleen.com, rppt@kernel.org, rientjes@google.com, corbet@lwn.net, rdunlap@infradead.org, ilpo.jarvinen@linux.intel.com, kanie@linux.alibaba.com, ojeda@kernel.org, aliceryhl@google.com, masahiroy@kernel.org, akpm@linux-foundation.org, tj@kernel.org, yoann.congal@smile.fr, mmaurer@google.com, roman.gushchin@linux.dev, chenridong@huawei.com, axboe@kernel.dk, mark.rutland@arm.com, jannh@google.com, vincent.guittot@linaro.org, hannes@cmpxchg.org, dan.j.williams@intel.com, david@redhat.com, joel.granados@kernel.org, rostedt@goodmis.org, anna.schumaker@oracle.com, song@kernel.org, zhangguopeng@kylinos.cn, linux@weissschuh.net, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, gregkh@linuxfoundation.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, rafael@kernel.org, dakr@kernel.org, bartosz.golaszewski@linaro.org, cw00.choi@samsung.com, myungjoo.ham@samsung.com, yesanishhere@gmail.com, Jonathan.Cameron@huawei.com, quic_zijuhu@quicinc.com, aleksander.lobakin@intel.com, ira.weiny@intel.com, andriy.shevchenko@linux.intel.com, leon@kernel.org, lukas@wunner.de, bhelgaas@google.com, wagi@kernel.org, djeffery@redhat.com, stuart.w.hayes@gmail.com, jgowans@amazon.com, jgg@nvidia.com Subject: [RFC v1 0/3] Live Update Orchestrator Date: Thu, 20 Mar 2025 02:40:08 +0000 Message-ID: <20250320024011.2995837-1-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.49.0.395.g12beb8f557-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: E8B5F1C000A X-Stat-Signature: kyw7k69wsmiwwkzcqwk5a8mtzxzduzhf X-HE-Tag: 1742438415-742418 X-HE-Meta: U2FsdGVkX1/SkqEYP2GMr7XHgj9KBj/0MAe2eLdGJCxxng/uqyRSfHwHyAX4fsZo6lNZ5wDu+VoEAygvn3dP3shL5Fb0/0TIWEo3lEkyVU1TQ7j+yRSMmwfVFqMH6i+XD15gs5iY8uGu0369ZZ7ROrNvqcUaLG8z7TlMmbGe11iOXUTzBC7dg0dC3ww7vKwP7ubduvwU2Q3nFapNS7AvCya19OZwGfYq57A+d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lLK+zS13NUp2+f4vDf5dA9sOmMQ2NZOCvW9lX9Pe+XKQDp6oxKuhzW17aGQ5XNvHPPJy6pSBX9Mu/Bn7LJtsDRrd/pKnQVY37mFODo0arl1Dj4GbqLxqgag6iTMnjYB9eu2y0U6EQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series | Live Update Orchestrator | expand |
On Thu, Mar 20, 2025 at 02:40:08AM +0000, Pasha Tatashin wrote:
> From: Pasha Tatashin <tatashin@google.com>
Note, this does not match the author and signed-off-by on the actual
patches themselves. Please use your google.com email address to
send/review/work on this.
thanks,
greg k-h
> > From: Pasha Tatashin <tatashin@google.com> > > Note, this does not match the author and signed-off-by on the actual > patches themselves. Please use your google.com email address to > send/review/work on this. This was accidental, I meant to use pasha.tatashin@soleen.com here, I use this e-mail for upstream work.
From: Pasha Tatashin <tatashin@google.com> This series applies on top of the kho v5 patch series: https://lore.kernel.org/all/20250320015551.2157511-1-changyuanl@google.com The git branch for this series: https://github.com/googleprodkernel/linux-liveupdate/commits/luo/rfc-v1 What is Live Update? Live Update is a specialized reboot process where selected devices are kept operational across a kernel transition. For these devices, DMA and interrupt activity may continue uninterrupted during the kernel reboot. Please find attached a series of three patches introducing the Live Update Orchestrator (LUO), a new kernel subsystem designed to facilitate live kernel updates with minimal downtime. The primary use case is in cloud environments, allowing hypervisor updates without fully disrupting running virtual machines by keeping selected devices alive across the reboot boundary. This series also inroduces a device layer infrastructure (dev_liveupdate) to be used with LUO. The core of LUO is a state machine that tracks the progress of a live update, along with a callback API that allows other kernel subsystems to participate in the process. Example subsystems that can hook into LUO include: kvm, iommu, interrupts, the Device Layer (through the dev_liveupdate infrastructure introduced in patch 2), and mm. LUO uses KHO to transfer memory state from Old Kernel to the New Kernel. LUO can be controlled through sysfs interface. It provides the following files under: `/sys/kernel/liveupdate/{state, prepare, finish}` The `state` file can contain the following values: normal The system is operating normally, and no live update is in progress. This is the initial state. prepared The system has begun preparing for a live update. This state is reached after subsystems have successfully responded to the `LIVEUPDATE_PREPARE` callback. It indicates that initial preparation is done, but it does not necessarily mean all state has been serialized; subsystems can save more state during the subsequent `LIVEUPDATE_REBOOT` callback. updated The new kernel has successfully taken over, and any suspended operations are resumed. However, the system has not yet fully transitioned back to a normal operational state; this happens after the `LIVEUPDATE_FINISH` callback is invoked. Writing '1' to the `prepare` file triggers a transition from normal to prepared (if possible), which involves invoking the `LIVEUPDATE_PREPARE` notifiers. Similarly, writing to the `finish` file attempts a transition to the normal state from updated via the `LIVEUPDATE_FINISH` notifiers. The state machine ensures that operations are performed in the correct sequence and provides a mechanism to track and recover from potential failures, and select devices and subsystems that should participate in live update sequence. ============== dev_liveupdate ============== To allow device drivers and bus drivers to participate, the second patch introduces the `dev_liveupdate` infrastructure. This provides a `liveupdate()` callback in `struct device_driver` and `struct bus_type`, which receives the LUO state machine events. The `dev_liveupdate` component also adds a "liveupdate" sysfs directory under each device (e.g., `/sys/devices/.../device/liveupdate/`). This directory contains the following attributes: `requested` A read-write attribute allowing userspace to control whether a device should participate in the live update sequence. Writing `1` requests the device and its ancestors (that support live update) be preserved. Writing `0` requests the device be excluded. This attribute can only be modified when LUO is in the `normal` state. `preserved` A read-only attribute indicating whether the device's state was preserved during the `prepare` and `reboot` stages. `reclaimed` A read-only attribute indicating whether the device was successfully re-attached and resumed operation in the new kernel after an update. For example, a VM to which this device was passthrough has been resumed. By default, devices do not participate in the live update. Userspace can explicitly request participation by writing '1' to the `requested` file. TODO: - Expand, improve, clean-up documentation - Embed a flow chart via Graphviz - Add selftests for LUO and dev_liveupdate - Add debug interface to allow LUO to perform LIVEUPDATE_REBOOT via sysfs to help developers of subsystems and device drivers. - dev_liveupdate should add KHO node names to dev / drivers/ bus, and also dev->lu should contain a link to a KHO node for this device that is allocated and freed through dev_liveupdate - dev_liveupdate should also partcipate during boot to track the reclaimed devices Pasha Tatashin (3): luo: Live Update Orchestrator luo: dev_liveupdate: Add device live update infrastructure luo: x86: Enable live update support .../ABI/testing/sysfs-kernel-liveupdate | 51 ++ Documentation/admin-guide/index.rst | 1 + Documentation/admin-guide/liveupdate.rst | 23 + Documentation/driver-api/index.rst | 1 + Documentation/driver-api/liveupdate.rst | 23 + MAINTAINERS | 13 + arch/x86/Kconfig | 1 + drivers/base/Makefile | 1 + drivers/base/core.c | 25 +- drivers/base/dev_liveupdate.c | 816 ++++++++++++++++++ include/linux/dev_liveupdate.h | 109 +++ include/linux/device.h | 6 + include/linux/device/bus.h | 4 + include/linux/device/driver.h | 4 + include/linux/liveupdate.h | 238 +++++ init/Kconfig | 2 + kernel/Kconfig.liveupdate | 19 + kernel/Makefile | 1 + kernel/liveupdate.c | 749 ++++++++++++++++ kernel/reboot.c | 4 + 20 files changed, 2083 insertions(+), 8 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-kernel-liveupdate create mode 100644 Documentation/admin-guide/liveupdate.rst create mode 100644 Documentation/driver-api/liveupdate.rst create mode 100644 drivers/base/dev_liveupdate.c create mode 100644 include/linux/dev_liveupdate.h create mode 100644 include/linux/liveupdate.h create mode 100644 kernel/Kconfig.liveupdate create mode 100644 kernel/liveupdate.c