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 18BBDC71136 for ; Fri, 13 Jun 2025 20:26:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8F5BF6B007B; Fri, 13 Jun 2025 16:26:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8CEF16B0089; Fri, 13 Jun 2025 16:26:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7E1EC6B008A; Fri, 13 Jun 2025 16:26:51 -0400 (EDT) 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 626D46B007B for ; Fri, 13 Jun 2025 16:26:51 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id DDAF61611BA for ; Fri, 13 Jun 2025 20:26:50 +0000 (UTC) X-FDA: 83551510980.05.03507A1 Received: from mail-qv1-f45.google.com (mail-qv1-f45.google.com [209.85.219.45]) by imf18.hostedemail.com (Postfix) with ESMTP id 1671E1C000C for ; Fri, 13 Jun 2025 20:26:48 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=soleen-com.20230601.gappssmtp.com header.s=20230601 header.b=ewvAbPgg; spf=pass (imf18.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.219.45 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=1749846409; 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=s1F7eBu2yh4yyIng6GZ4YIrhraTRHuVfaAEr8sxIw/I=; b=Pjk3rmJu8ojYMlwUwmKumOfghYmqcFv/sUs1F6VTTc9QXS2RD6sM+enEfBQG0XSeLLjVPs TwaUT8/nfwEsukQ/hrtDwHolnJTHfUEg4oadgTn56pHgTGslrjMteiZsAVpcOnyHRuVlOA N4coDw5LrYWRI7eS7vCf9vAz/Dx4INA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1749846409; a=rsa-sha256; cv=none; b=yv6ZN383Jz0vL7qKoxs5RmrKnEN/k9jNxCXXPH6lvUFtUdLP2kXecG/jjxdnfIuq0VDI2Q 6KJINuqRzX4skZp5vjARoqEmtZ5TlVfkh046y3ua6u6Un/eibmzeXeW7Q4gt+6aOVc+Euj 7CBDNdew/QXS0Te6DWckOZFHCJNZLW8= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=soleen-com.20230601.gappssmtp.com header.s=20230601 header.b=ewvAbPgg; spf=pass (imf18.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.219.45 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com; dmarc=pass (policy=none) header.from=soleen.com Received: by mail-qv1-f45.google.com with SMTP id 6a1803df08f44-6facf4d8e9eso27523726d6.1 for ; Fri, 13 Jun 2025 13:26:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen-com.20230601.gappssmtp.com; s=20230601; t=1749846408; x=1750451208; 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=s1F7eBu2yh4yyIng6GZ4YIrhraTRHuVfaAEr8sxIw/I=; b=ewvAbPggHiacDaadsCN6YoaNyALkXVMDCC0EmyGbhV6/62dV4UBMomO4T74gPTBnOo HTm9fI5mOdeXMTq//ZOyHF2WF9XDgXYsUqGbEM5FD4eauBjOPJ730Dgi65Khhyt3XIAv h/QO/qBXaLPLpedVADYJolKFGnTLyXsgboYWSs65j/G2HknysbTdY9++fL7tFuPrUHAS zhARj6O3wmjOV56qEhv7bJyzvHJdnXWwzQEW+IY4hCqmTebU9Qw3yXJZwsoKLXDRPAKS ztYdpRL7qtiSPK1Wwyt+COrT4xqmv9M1J8UOywvW/gKBxnhTlVUwAktrDLN1iEugvG/M jpaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749846408; x=1750451208; 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=s1F7eBu2yh4yyIng6GZ4YIrhraTRHuVfaAEr8sxIw/I=; b=vmn5ylwNnqCfuOUyFKIUuRRPuYuR9vvKwqZ5VkImDsP+jVgfEwvfgbGtJp+DLXpUnq SaBfavOn+ikCCRe9vLeP+9HdUc91SzT9jOWbniAirLQML+B4gVvEoX/V8Ni+rli3Uflk /syUh3O9AuT/7iSJyxwP9zZeInX1rpS5sovd0wVk2n2lCij0x4B3oKJjTBynTNdj37fe VjLOuF9PWnf0qEOg1a6EAhJVK4CJPADmaJA43DAMCVztK9uMHzggURNZFD+ba0Z25nGo H2USJKL790OO/3fIQD40WBOCsif3bgX39go/mchD4d8hJFFPlJDx7WmkqF4vlov8O80F p+VQ== X-Forwarded-Encrypted: i=1; AJvYcCVKHhA9au/rWRxni4UNgbw8GGgMQHIw7a72jBVyk/g7Jc7kQJU3SALKzo+m0oMLTWCHk8SyWRsLrg==@kvack.org X-Gm-Message-State: AOJu0YyExjKrHXQfEoG6tB6j/qWaqgGn+GL+MtmIWVkoisEuyAsXAUzh FvAd1Qj3JCoZb2vhW3bO4cmClAo4t0OyVNtfy5666JpcMvLtu9wt6zsAiBFEahH9CBv9xkFOj5O Zap2BijJ9pzjXEsp8PQiDjMGr2f+9NmSp6HPiWpBAtQ== X-Gm-Gg: ASbGncvjdjx/BDdXqpbdB8k5hTwzmVkhXNpH81TdRdQnJ7fFVojne30raeJHa/Ah6Se M0Fil+MmJ14RKJRINjPo8HkHKTbVx4RdV+cOPCvRXyQ9vay4G0RHQX+DGHslH1/Mogi06XonXdp KC5KSEc/sD5hV4F+YBzp/+UWajTOPtGNckEudqkGqR X-Google-Smtp-Source: AGHT+IF3nwss38w+6sPte2LyqGqKz6Z8Ac5rw75TrU6T2qKoe2RWjWXsO/0k7+DIxBlrqkXH+4SsDrUNg7bBmP0KMdo= X-Received: by 2002:a05:6214:2022:b0:6e8:fbb7:675b with SMTP id 6a1803df08f44-6fb477a609cmr14338616d6.32.1749846407982; Fri, 13 Jun 2025 13:26:47 -0700 (PDT) MIME-Version: 1.0 References: <20250515182322.117840-1-pasha.tatashin@soleen.com> <20250515182322.117840-10-pasha.tatashin@soleen.com> In-Reply-To: From: Pasha Tatashin Date: Fri, 13 Jun 2025 16:26:10 -0400 X-Gm-Features: AX0GCFuCENC8DGDNRlKtZr6QEPTNog2Lyu6MfBppirHIT_JNXbHcfvU0_kVcGIQ Message-ID: Subject: Re: [RFC v2 09/16] luo: luo_files: implement file systems callbacks To: Pratyush Yadav Cc: jasonmiu@google.com, graf@amazon.com, changyuanl@google.com, rppt@kernel.org, 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-Server: rspam10 X-Rspamd-Queue-Id: 1671E1C000C X-Stat-Signature: nc1i4p41ujeeeknfhntqq7nnnxtyndbo X-HE-Tag: 1749846408-5896 X-HE-Meta: U2FsdGVkX19fiLCEu+Gv34+78AgmPv/xZ3F8I5FHJLQAr8AdrbcP0S324Ttw0SlMWHM1buQJpxSJqq2WfwU7ftW9K0VZaIbY1LKLnQArkZorTvcIQh2B9qKi50WuKdggTvGeAvjlWaTAAmpNN0gPzFsow9ZAmDH+8jEDdzlbgNMBpFe1BL5Cl6lc7Ue8BdGF4KdzAP5pVW8CqAZnLs1Ep9UOOFY9+V572Bl7liMHZ3syoN8vJLmxwQGg2hO5Fb+JL2KJ8wIt3c6cpvyhyUolWY965wmTH2llsqFxmto+8yI32sGTsjvI/P3uf9icMFWH8nMwoX9l384C5P0yLtPhF1Q7loufK5N4t65nSezT30PHXb2DuZL5Y3IN8NWACa0wybcS1TVAVlkisGWbFkffXh/1zxQnr8uDRzni1UeoikxtDXHgbfZdgU+ZnsBwFtJnWoZ96Y781+sETd6GuMEbKsvlbJInTDqKAtrrPN4Qo8ZJG1Kj4brjYNebjrCoOBp+ZaB1NeJEXT2c/m34ZkAWq3l08yHWiBjfhmXYYRWiHM9GX5IEgl+SbZAWqXIllf0eUy58ueLdvC3fVqnkycY8zm8pPg20ZHjfjvHMBp9bMROqWK7iAOEPbKwiJ6vk7dTN8gt2c0W0MiqiL+z2SW5UUTnSPPCDkeHKn4JZSMTudFRF5An1EL992LCGomwH32nWTUVjXiQ+wfRNWIN7Sruw90QvDCeyiJDorgomAI7CjFEoSf5Oz67IAS7/UoGsudEJw8kEPTm8EGYAt13KYzXoXxd8Iz6freJaJtje5o/9tfWOv7sm3qWK9giAXVABtpFvO6jZxmDWM2P26F7v6uKrqWw5KovRY2WMGOL+MmqXRvlDLTiDtCug4tjYw5SKwgCQqqQxJj7mSAsODCtXqWwSvbpBHKEB342aEzjNhIQJCm2mCdnqslgkc5v7Li4Nassduvci2yWorQjERDbR0iN rKbO0/WF REH/MmjmLS9jcejGzdQCw+qvihJ2uzqlQzndXVwxLz05MFcSepIOdpPNl2vPC1lds5O2AdlhHn0vDaTjReF34fnvqqMJg+pPjICBzA9ilcS75ytKgjq7J5s4DDA== 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 Fri, Jun 13, 2025 at 11:18=E2=80=AFAM Pratyush Yadav wrote: > > On Sun, Jun 08 2025, Pasha Tatashin wrote: > > > On Thu, Jun 5, 2025 at 12:04=E2=80=AFPM Pratyush Yadav wrote: > >> > >> On Thu, May 15 2025, Pasha Tatashin wrote: > >> > >> > Implements the core logic within luo_files.c to invoke the prepare, > >> > reboot, finish, and cancel callbacks for preserved file instances, > >> > replacing the previous stub implementations. It also handles > >> > the persistence and retrieval of the u64 data payload associated wit= h > >> > each file via the LUO FDT. > >> > > >> > This completes the core mechanism enabling registered filesystem > >> > handlers to actively manage file state across the live update > >> > transition using the LUO framework. > >> > > >> > Signed-off-by: Pasha Tatashin > >> > --- > >> > drivers/misc/liveupdate/luo_files.c | 105 +++++++++++++++++++++++++= ++- > >> > 1 file changed, 103 insertions(+), 2 deletions(-) > >> > > >> [...] > >> > @@ -305,7 +369,29 @@ int luo_do_files_prepare_calls(void) > >> > */ > >> > int luo_do_files_freeze_calls(void) > >> > { > >> > - return 0; > >> > + unsigned long token; > >> > + struct luo_file *h; > >> > + int ret; > >> > + > >> > + xa_for_each(&luo_files_xa_out, token, h) { > >> > >> Should we also ensure at this point that there are no open handles to > >> this file? How else would a file system ensure the file is in quiescen= t > >> state to do its final serialization? > > > > Do you mean check refcnt here? If so, this is a good idea, but first > > we need to implement the lifecycle of liveupdate agent correctectly, > > where owner of FD must survive through entering into reboot() with > > /dev/liveupdate still open. > > Yes, by this point we should ensure refcnt =3D=3D 1. IIUC you plan to > implement the lifecycle change in the next revision, so this can be > added there as well I suppose. Yes, I am working on that. Current, WIP patch looks like this: https://github.com/soleen/linux/commit/fecf912d8b70acd23d24185a8c0504764e43= a279 However, I am not sure about refcnt =3D=3D 1 at freeze() time. We can have programs, that never terminated while we were still in userspace (i.e. kexec -e -> reboot() -> freeze()), in that case refcnt can be anything at the time of freeze, no? Pasha > > [...] > > -- > Regards, > Pratyush Yadav