From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 16E41C71157 for ; Wed, 18 Jun 2025 17:01:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9377E6B0089; Wed, 18 Jun 2025 13:01:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8E7346B008A; Wed, 18 Jun 2025 13:01:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7D6346B008C; Wed, 18 Jun 2025 13:01:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 6B5466B0089 for ; Wed, 18 Jun 2025 13:01:34 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id F3A2A16059B for ; Wed, 18 Jun 2025 17:01:33 +0000 (UTC) X-FDA: 83569137708.06.3D2BC18 Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) by imf09.hostedemail.com (Postfix) with ESMTP id F259514000C for ; Wed, 18 Jun 2025 17:01:31 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=soleen-com.20230601.gappssmtp.com header.s=20230601 header.b=ponvShsd; dmarc=pass (policy=none) header.from=soleen.com; spf=pass (imf09.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.160.170 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1750266092; a=rsa-sha256; cv=none; b=vZiD3+QEJgme0xDk0wgZUWK/7SYQ5HaLlwbHWxriy4ty3sBhyUFQv5g+tRgRtis7dqhqlN qBn8rVVIxHTE7/TT4NqeWfD4MccJ25Zkc15Qv4vZoVaos7GGwkAU3L2IFC28yYn13pqSGF wFoPNf2vxcYayLqkN73m6eoiPgqbw+Y= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=soleen-com.20230601.gappssmtp.com header.s=20230601 header.b=ponvShsd; dmarc=pass (policy=none) header.from=soleen.com; spf=pass (imf09.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.160.170 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1750266092; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=TA0+RKC/kBCuCd8gwsReWHIGYtk514yw93ZXeGqDAdY=; b=3VQipRofDylpkGSVH2+SFMXonnDrkoDv7Bpjth7Vw717F/B8oLr/GuSKF1TFO4zhfAVfsE +UzOTz78W54J28JA5WJ9qUJnzB57ZHIAa9MQa9exaYXEjWzGSbdQzXfc8/E6EhayhrpFYk tGYidqxuzPUFEdA2RJrOmC5ukpSDGlM= Received: by mail-qt1-f170.google.com with SMTP id d75a77b69052e-4a58f79d6e9so87671701cf.2 for ; Wed, 18 Jun 2025 10:01:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen-com.20230601.gappssmtp.com; s=20230601; t=1750266091; x=1750870891; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=TA0+RKC/kBCuCd8gwsReWHIGYtk514yw93ZXeGqDAdY=; b=ponvShsdO0SSuhI/wzVuluGyQVWBgYYe4YReR5ATrq8s3Is7WI7DkyMn8iTsE8j64x +z03Vc/qtqdrUGlsLmI8Jxt5+p8NWPBDna9U0r968ek+MOAmShV1sD8YTruv2q5JDTcm ABoTyOeqYqGnqidS9haHPJQ/HNx2JYHsyCiLVty/28Q2TLewwIIwCSsRp+ip2Net2Vsp 2J8NFsG5wmJGtTf47m0IUlGsH6v/XMzTV9x2MJw512T2soZZ+FQBWR6RE0yM8knwKcXD mWxK5zYaYhC6887Xxxe1e65D6OpUF5/dyPQXh8+MeOY+vUDFdCRuT2cpx7X7V9/YWWe7 ot6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750266091; x=1750870891; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TA0+RKC/kBCuCd8gwsReWHIGYtk514yw93ZXeGqDAdY=; b=le2VQ3Fl083KiqYNyiVFfmnYIe836/w8ZI3ljENDE+kZNHl7A4OvVGdsaqCOjEg+K+ v4u4BMvfTDmLiw/ROLuGxK2IgQs6ICsSELm7/Wg+y4UzkmPb2H2XdwoEEdFzmC/+kUW9 VgnZkB5gbqa5kYbRNRsC313QQhx3HfpUVXoEDOJ2ju2kNvt6HzJsC/I6Y9d7sqELAIbt tEZIGTH1h5/bWKpzLg7efIrHOxnQgKMKRcsCcWdkDMaCndiQHprdmM5UsIp2r+abLuqJ VYV11kGia/2WJ518NJF6owrJKCG+d5pgZSZ4C/6W2/CHKoXieJeI6gWSlyqLY7wxUrWX FsnQ== X-Forwarded-Encrypted: i=1; AJvYcCXmk5q0v9cJC40oQDmvoiQOZDRpCJq/apzR6day1Ic2D2yaNK4j+yabLGyNgeoWI/nrImzipRX/xg==@kvack.org X-Gm-Message-State: AOJu0YzP6ZcH4u7PXV2mvKBMJxmR45k1zNuEUHNkl9g0Is+ov6gdJnt5 LCYZ6NyS1nZkGEl10yiE1pjHwfDSEfIxSKDlCUgkWs+J5HMzjDaXqwnlMNgXnIO36yTVsYIGQ2t YHR9KVIQVmeEC5wC+QAXvSgyWBAxYL7C25TlQ+iUP3A== X-Gm-Gg: ASbGncuulslDwQkOcEHXK15yygkKctfCeJNDBgdNGTFv5NrN7pclsFcw0YqsQtgmf+j /RKwO3g33Fa5PQkDA9EU8bc21bADDOY/8RZUeoROxxE07vfqmvyryNZw+oXV/N65ATqT7NpnxFW YtwYhQjbzGwGQxJ52f/YIlNFpnTLRyaqk2y0cscltR X-Google-Smtp-Source: AGHT+IEl9+a5umJIH2rn3eRvV+cj4/+EVnk+rRUutzocygxatHb141CsA1O9nuYeCr3Vjm2y753eIgh3RePJyZR2zuM= X-Received: by 2002:a05:622a:109:b0:48c:5c4d:68e7 with SMTP id d75a77b69052e-4a73c51f8f9mr255163841cf.6.1750266090667; Wed, 18 Jun 2025 10:01:30 -0700 (PDT) MIME-Version: 1.0 References: <20250515182322.117840-1-pasha.tatashin@soleen.com> <20250515182322.117840-6-pasha.tatashin@soleen.com> <20250617152357.GB1376515@ziepe.ca> In-Reply-To: From: Pasha Tatashin Date: Wed, 18 Jun 2025 13:00:52 -0400 X-Gm-Features: AX0GCFsc07ypzImQ5QOUs6HD_8XNfOFWbKkbcbmfbfu3dfMzeXoTO_-aNByV3mg Message-ID: Subject: Re: [RFC v2 05/16] luo: luo_core: integrate with KHO To: Mike Rapoport Cc: Pratyush Yadav , Jason Gunthorpe , jasonmiu@google.com, graf@amazon.com, changyuanl@google.com, dmatlack@google.com, 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspam-User: X-Rspamd-Queue-Id: F259514000C X-Rspamd-Server: rspam02 X-Stat-Signature: pxxjnqrx1gcsm9autn4n6h6fu3qpta5n X-HE-Tag: 1750266091-457720 X-HE-Meta: U2FsdGVkX1/QbEIXLz13FVcy0Rtw7UV/ANtGVMaLLS7tCNquRL+s5KWLfoJnYfR++voDi7lSFIKm/qhsizpWtBd1xprHhqFn969zvOxZs8P5Tk8HI/vLHFsb2VfvoA31aJsY+2aUniRkwuRloXpITvlo2w6ynnLdmAJ4iv7XfEHnY/ot3uwQ8hBGi6UcWKu0zvCeJx6qIMF0ItdRReLgbqEb83RxWgwF2QrD+xo7vpiZYc/fx6e6sYBKG5xy5xae3TTd7aVgrG1E4btD0eJz8aHpCVLBgzrwBHce+utClcm7yZ1qCCzVIJ2qZg4mG8Fy7Fj+Qw2Bt5ARKPRcvPMiIz/t3DK39vtEAS5i6wP7CoY+iRyvedhMZSz/gKS6VifKGfCNqAknELgveojWrORbVvz18nKMqgUKkjmGVTuM9biztxaDCZh8Z5yv7GfYFRDZhGPuoksescaQSe6qgFrCEI7MwHXbkT8GxDgifkLztjJ7c2bHtlVv7jhvVRwm0RiwZA1deeV7OOuqaUnDIIhN5BYT1TUhq79CI79hrn6xodyGzXbhyafg6lqZGEwUWZ5IiN+QNYlHj2Ex9Wz4uKHPqeXZM+86m9gx4bJ1eX1uds/3EK5U1C4dgL3uAdbpQBO68VE5W/lSkcHyRIuz9lfAZC/YRAnMxoQgEERw/sGrG84SgbvdFHZL4QwI1S8ZY+Y5/JR68gMRxU4ApiapfffEs3e70ugwpkiasNmQLmsFeatehPa03OSngsZZU3lNXfd89J1uMMOT5HET64o7NlamGC0xyy7JBLN6PrqURfsZVThW+zm2v39p2zarfFcyj26RFaNuHAu7KsaptbXBsqbjIp7EevKjAbJf/FxYxIK0CWfTVHjGqfrRui2geujSu5quUD0NDikZi9ESsMta1OlWwgldR4iJDmSkvWpuxg8mNAlaeMtEZ6RFUGtR+Uqe1cra4AtLxHxV8hePEsBnr57 oPLyfzvy sjTpUlMUn8xQaAWIm3BO8O4zhL0xwiEPv8XPu1uULL3/Az7GqIeiyzftQU7PbEfqk6qpayd/yE8hdzti6s/ZaP6Kf918NFEemreplDfoSPwxI5/H5H5BTyMHryesl1rsBnP03NDz4sMPK7jv3ZCNFyIXwRTRzmXAIABgE1XIkcVZKhR/wm/heHvUXm37TWnDqEVW1GZKlnoFvaiUCQmPNpW1Gcccq3UtLKAthInWCMBz9xBRoL9PtoZD/Q+4aCIlh5wuk6DXaMXq4U4vjrYbRHLG2g7tfRgBwGWGsz3hrGeN25nEINfu8NtxmxHsuvr81mebaBe0ljm0XlXWWKAWEG7eKkSpY0vDs0xlL7GNzh/VyU8+fd+LLGSpkbbQvdo5wTg4OuG/j/H0dCO1ki7vuKFJ40qOMVTEbZoBz4wr5W7yCnhu0b7TmxWtL5qhD5L8O+uMa5Z8sX/i+IPI= 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: List-Subscribe: List-Unsubscribe: On Wed, Jun 18, 2025 at 12:40=E2=80=AFPM Mike Rapoport wr= ote: > > On Wed, Jun 18, 2025 at 10:48:09AM -0400, Pasha Tatashin wrote: > > On Wed, Jun 18, 2025 at 9:12=E2=80=AFAM Pratyush Yadav wrote: > > > > > > On Tue, Jun 17 2025, Pasha Tatashin wrote: > > > > > > > On Tue, Jun 17, 2025 at 11:24=E2=80=AFAM Jason Gunthorpe wrote: > > > >> > > > >> On Fri, Jun 13, 2025 at 04:58:27PM +0200, Pratyush Yadav wrote: > > > >> > On Sat, Jun 07 2025, Pasha Tatashin wrote: > > > >> > [...] > > > >> > >> > > > >> > >> This weirdness happens because luo_prepare() and luo_cancel()= control > > > >> > >> the KHO state machine, but then also get controlled by it via= the > > > >> > >> notifier callbacks. So the relationship between then is not c= lear. > > > >> > >> __luo_prepare() at least needs access to struct kho_serializa= tion, so it > > > >> > >> needs to come from the callback. So I don't have a clear way = to clean > > > >> > >> this all up off the top of my head. > > > >> > > > > > >> > > On production machine, without KHO_DEBUGFS, only LUO can contr= ol KHO > > > >> > > state, but if debugfs is enabled, KHO can be finalized manuall= y, and > > > >> > > in this case LUO transitions to prepared state. In both cases,= the > > > >> > > path is identical. The KHO debugfs path is only for > > > >> > > developers/debugging purposes. > > > >> > > > > >> > What I meant is that even without KHO_DEBUGFS, LUO drives KHO, b= ut then > > > >> > KHO calls into LUO from the notifier, which makes the control fl= ow > > > >> > somewhat convoluted. If LUO is supposed to be the only thing tha= t > > > >> > interacts directly with KHO, maybe we should get rid of the noti= fier and > > > >> > only let LUO drive things. > > > >> > > > >> Yes, we should. I think we should consider the KHO notifiers and s= elf > > > >> orchestration as obsoleted by LUO. That's why it was in debugfs > > > >> because we were not ready to commit to it. > > > > > > > > We could do that, however, there is one example KHO user > > > > `reserve_mem`, that is also not liveupdate related. So, it should > > > > either be removed or modified to be handled by LUO. > > > > > > It still depends on kho_finalize() being called, so it still needs > > > something to trigger its serialization. It is not automatic. And with > > > your proposed patch to make debugfs interface optional, it can't even= be > > > used with the config disabled. > > > > At least for now, it can still be used via LUO going into prepare > > state, since LUO changes KHO into finalized state and reserve_mem is > > registered to be called back from KHO. > > > > > So if it must be explicitly triggered to be preserved, why not let th= e > > > trigger point be LUO instead of KHO? You can make reservemem a LUO > > > subsystem instead. > > > > Yes, LUO can do that, the only concern I raised is that `reserve_mem` > > is not really live update related. > > I only now realized what bothered me about "liveupdate". It's the name of > the driving usecase rather then the name of the technology it implements. > In the end what LUO does is a (more) sophisticated control for KHO. > > But essentially it's not that it actually implements live update, it > provides kexec handover control plane that enables live update. > > And since the same machinery can be used regardless of live update, and I= 'm > sure other usecases will appear as soon as the technology will become mor= e > mature, it makes me think that we probably should just > s/liveupdate_/kho_control/g or something along those lines. I disagree, LUO is for liveupdate flows, and is designed specifically around the live update flows: brownout/blackout/post-liveupdate, it should not be generalized to anticipate some other random states, and it should only support participants that are related to live update: iommufd/vfiofd/kvmfd/memfd/eventfd and controled via "liveupdated" the userspace agent. KHO is for preserving memory, LUO uses KHO as a backbone for Live Update. > > > Although to be honest, things like reservemem (or IMA perhaps?) don't > > > really fit well with the explicit trigger mechanism. They can be carr= ied > > > > Agreed. Another example I was thinking about is "kexec telemetry": > > precise time information about kexec, including shutdown, purgatory, > > boot. We are planning to propose kexec telemetry, and it could be LUO > > subsystem. On the other hand, it could be useful even without live > > update, just to measure precise kexec reboot time. > > > > > across kexec without needing userspace explicitly driving it. Maybe w= e > > > allow LUO subsystems to mark themselves as auto-preservable and LUO w= ill > > > preserve them regardless of state being prepared? Something to think > > > about later down the line I suppose. > > > > We can start with adding `reserve_mem` as regular subsystem, and make > > this auto-preserve option a future expansion, when if needed. > > Presumably, `luoctl prepare` would work for whoever plans to use just > > `reserve_mem`. > > I think it would be nice to support auto-preserve sooner than later. Makes sense. > reserve_mem can already be useful for ftrace and pstore folks and if it > would survive a kexec without any userspace intervention it would be grea= t. The pstore use case is only potential, correct? Or can it already use reserve_mem? Pasha