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 D568B606A337 for ; Tue, 10 Nov 2026 15:45:41 +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=Ukz+9Mhm Received: by kanga.kvack.org (Postfix) id DA3146B05B7; Tue, 10 Nov 2026 10:45:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D53FE6B05B8; Tue, 10 Nov 2026 10:45:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C69E36B05C9; Tue, 10 Nov 2026 10:45:40 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id A375D6B05B7 for ; Tue, 10 Nov 2026 10:45:40 -0500 (EST) Received: from smtpin23.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 352C7160874 for ; Tue, 10 Nov 2026 15:45:40 +0000 (UTC) X-FDA: 85419634440.23.6281444 Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by imf07.hostedemail.com (Postfix) with ESMTP id 949E640005 for ; Tue, 10 Nov 2026 15:45:38 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=Ukz+9Mhm; spf=pass (imf07.hostedemail.com: domain of pratyush@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=pratyush@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1794325538; 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=T4MRWNIKTZkEJgt6oLMqXnO3+RBTvl3UjB+JLMtpOKY=; b=GhY9Db3p/nFu9hGeYz3xpcxuHRUBOn63VdxxpnerBSiP9Xzb/6sAk2W7uYiq5M7dP3dgtP eVYpb0BTstFFfz7HFD3sPD78jIayWfgUGX8BuoLodLS0Hvr6lTm0ea6BHImd+jXG0zUPPU 3AhcTn3Tkqik7gHtZH6ZMBePpgMQ1aw= ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1794325538; b=fYNM8M7bdmI8JNReEqKB0S5P4yp3LpgJvBH/V9s8JrNTLg3HNS4DUbB3JxJOwmDBFHF8H8 0Q7WrMhDXPNRM94fYZh3Sil+TTvjPXGNBGNaL3Y0mGz90xWpLHZBQ7BHfxJgrXrSXhuIis 64HnCOOIqAE0NRCHSlku0wdTwx8voms= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=Ukz+9Mhm; spf=pass (imf07.hostedemail.com: domain of pratyush@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=pratyush@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id D720263A37; Tue, 10 Nov 2026 15:45:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7F171F008A1; Tue, 10 Nov 2026 15:45:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794325537; bh=T4MRWNIKTZkEJgt6oLMqXnO3+RBTvl3UjB+JLMtpOKY=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=Ukz+9MhmJgvTDWk/SeEpiCCkI/fDF9KMsJ5erGKGHdcFKSmOVmYTuc9CGKNmi6DYO dkn7GN9I36tJwFurwtLxd9tnH4rhP3ZTL0xTnvt8Ej6TGmAUntAB+/8ZIcRXL2dQ+g rifN3NXh9WBsTGWuMkwOlo+7aSbKUH3BUb/8YMVD5rvHHb+nZAmuu1RZ1qGQrm8aKZ kcR26N0KwEtsC9GIr9bPuaxztpOFhhIPld6MzOkHAzbhZ/SmJaUr+k1/kb1ShQvPaB ut0RjG/3MNIuOJ6mZDzOQw2lxSHNBQf8C7PmVh9omoU0F2pwM7nyjwYn7HlSS1l2OV uoB3ljY2gbHUw== From: Pratyush Yadav To: David Matlack Cc: Christian Brauner , kexec@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, Alexander Graf , Andrew Morton , Baolin Wang , David Hildenbrand , Hugh Dickins , Jonathan Corbet , "Liam R. Howlett" , Lorenzo Stoakes , Michal Hocko , Mike Rapoport , Pasha Tatashin , Pratyush Yadav , Randy Dunlap , Samiullah Khawaja , Shuah Khan , Suren Baghdasaryan , Vlastimil Babka Subject: Re: [PATCH v3 00/10] liveupdate: Preserve tmpfs files across Live Update In-Reply-To: (David Matlack's message of "Thu, 5 Nov 2026 16:52:30 +0000") References: <20261103010216.3447716-1-dmatlack@google.com> <20261105-sitzordnung-nahkampf-ausbleiben-6db911d0333e@brauner> Date: Tue, 10 Nov 2026 16:45:32 +0100 Message-ID: <2vxzbj7witb7.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-7.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=4.0.1 X-Rspamd-Server: rspam09 X-Stat-Signature: 6ngyzek53o9u1d11mhupowa3qppoqhyt X-Rspam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4W251j2isIeHAyi1rC/chSaDUX1SAr++7z03tiIVDQCUTWg0xwCYv3L5TdxSDO5no3Jb0nVhBuKa0xpo9c5Cbbz8tBf7XqpsxcIFNmGXe3tOBT0C47WcMAPFrliJyCGgFVWd+kvhVGC3eWAt/n9qccwLZfkP4IP4BFogd1W6j82o7A== 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 David, On Thu, Nov 05 2026, David Matlack wrote: > On 2026-11-05 04:42 PM, Christian Brauner wrote: >> On Tue, Nov 03, 2026 at 01:02:06AM +0000, David Matlack wrote: [...] >> So instead of LUO handing out a file descriptor for a file it invented, >> let userspace create the file, O_TMPFILE, O_CREAT, whatever it likes, >> with the owner, mode and xattrs it wants, and let LUO put the contents >> into it. That's what the RFC did. > > I'm fine with going back to that in v4. The retrieve argument will just > be a file descriptor for the target file, and LUO will only restore the > contents and size into it. Everything else about the file is up to > userspace. > >> The checks on the target are trivial: a writable fd to an empty shmem >> file with the inode lock held while you fill it. A tmpfs file can't be >> sealed, it only ever has F_SEAL_SEAL, so there's nothing to restore but >> contents and size anyway. > > Sounds good. The one other check I plan to add is rejecting a target > that LUO is already managing, e.g. a file that is preserved in an > outgoing session and whose size is frozen. I have been playing with this idea too, and I also stumbled onto this problem. You also need to make sure a preserve doesn't race with a retrieve. Since userspace has access to the file, it can do both at the same time. I think LUO should expose a "register file" function that registers the file in luo_preserved_files. This should be the very first thing retrieve does. Also, today LUO core expects a fresh file from file handlers, so it always installs a FD to that file in the task. When doing the "retrieve into FD" thing, that will result in two FDs to the same file. While it isn't a strict problem, it seems kinda ugly from a uAPI prespective. Perhaps we should let retrieve signal to LUO core that "I already installed the file", or a "I have no file to install", or something similar? > > LUO will also add the folios while i_size is still 0, and set i_size > last. So reads, page faults and memfd_pin_folios() wouldn't see the > folios until the file is complete, and if the retrieve fails partway > through the target is left empty. > [...] -- Regards, Pratyush Yadav