From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF5D835A141 for ; Wed, 29 Oct 2025 20:44:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761770667; cv=none; b=D+JKwcWE9dUIS2joaFxqvt6xdNEDzD38Zal21AnCvJmAACT1anqqAiNYx3WcA0/k5QVDKM/FqObwPDG9BHAaomB/dYLj6MkAk3uw+R/03CRwryvpemG7KZFtir78yEzLn5hLvVZGqymVRUP+TKEMcTAzs54EYwfhCX+0ls1Bw0k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761770667; c=relaxed/simple; bh=/nRyrHH69bDwdkUwV+ZvUiMlkERSxLC5qY0L4yNkpAA=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=rqKO2JP02B/6FvE95ncwlphdP9HlRDeoh3rY1DmUiClj7sZo4g0X75mH4GlMiqnq2fVXJ3kOA2khUDBGwn0gE7LTsbpyeOHIUc80GMhygKKOgHbbLKvv7nC7fX7fDJmYM97nLsiI55lYtnXYXxeAG+FLpKYXdbiA60YwtX3Km0s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=ZIT8FZH5; arc=none smtp.client-ip=209.85.208.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ZIT8FZH5" Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-378f010bf18so14819131fa.1 for ; Wed, 29 Oct 2025 13:44:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1761770664; x=1762375464; darn=vger.kernel.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=/nRyrHH69bDwdkUwV+ZvUiMlkERSxLC5qY0L4yNkpAA=; b=ZIT8FZH51950wDS/bjbvoKGOA8qhHonV7KO9v4ASHE/9xRn3ynMtghPFcpBjOistJH 2lDJC8qO5e33qWIzdICHnbPQyQbleSTxhRTXXmBRLGOGCyZzy+q1Sd+c4kD9S/keZClS MZt8ZPz7P4MLIzfxWg2TmnOnQZh1igfmm8ZEeJ8srgrqVAyq+4zbSyFWUbE7XBWoPObj jw6yyodMDdTkDAscIF6SN8BwOhAbZUdl9M4vi15xPNeKdSfMqdZWqtIpGdFgtw+Sa8tW WjRpVWRJwEG8tvxYBPzUBdlm27ROSFhNUxSh/hDPDKJJLfUfuJmwJAxMt1X6eC6zK8u7 BRWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761770664; x=1762375464; 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=/nRyrHH69bDwdkUwV+ZvUiMlkERSxLC5qY0L4yNkpAA=; b=A4TVOf+p2yAxF1T15TZOkMd9TRFmpwUEcKljtaCLN0wrWQTuPwa0Sn2FCpR3HDhRol 1Y5+P0Iy8z3gDE1XJ3TcrL1+s3sanhU0/bEwvC2pzXKyNPTxJ7+6SZLfyrmv+wX4Fh8j Z0XG9nfau05Iiq79mCznbhlREEIecUrDV6KxEXA4G5PEdXWYSU330I916wfnx1KJ5WAx /+EhnuonFJMLZSUSQXxH5APfK6DHvhryhZ4XPYdrhsGk1OzOjPniDIbcZTY13mEUipGZ WtbwrGzDF8xqsehu5otGCixgCDdw65qQ+fIpPB58sYeCTrniflAV5KLbFMLjrGdOli+i Ef0A== X-Forwarded-Encrypted: i=1; AJvYcCVjW5WTsozjO255rYLoDQBKfafcJXvQQsKMmwc38/kB7tl2CLQn7BDCEwlF9IUGwJgiMkyBIsEI1FFlyuJ6@vger.kernel.org X-Gm-Message-State: AOJu0YytaTT45IUD+68iMLKQFticYGpU4Ff+z0NLhJGD4EX3OfPw+6Rg fr/b3moKlTs6JJ2ONzaS9vcPAx682WdhD0ki5noqYF6kHLtFJlbAbtJRx32GPH0GCNmCMdDf9PV xRzszE1v9Kit6FKGl4yHDJgCvsuOMeK74UWxe7PhX X-Gm-Gg: ASbGncvRUpdjK5XHhZuTIXnGmgoNrjdr6w7zxxpduDeHF3RFJ+0R7IqFbouefYFBeNK KxUH8q1DKTfs1rY/tLFLZnzyKf5JNVyE+rlzALzXKupekG32ShBJyc6KfOr58sDBkbufkNtg7tO T8qXgFv8kzDyx78SFHElpldunDFaczeke/hvqQDAMWz+FnJ0ziREiwxTONXIm/Jym/qQMl7588M OL0Ys2GNrJG7Y6k4vior8Bi31EuHwUsyYw8T0RdOD1s8LWM1EaO9VmB76TZ X-Google-Smtp-Source: AGHT+IFRYtH5XfTJnxxGfkJO0Gi6f1H2nFBXWvOk+OBKFsn98ppWQIAtWYQQwdGEa9VK8XbxcXnwXcPQMdyC3mUpVtI= X-Received: by 2002:a05:651c:32a6:b0:378:d020:b6b3 with SMTP id 38308e7fff4ca-37a1068ccefmr2106821fa.7.1761770663502; Wed, 29 Oct 2025 13:44:23 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20250929010321.3462457-1-pasha.tatashin@soleen.com> <20250929010321.3462457-15-pasha.tatashin@soleen.com> In-Reply-To: From: David Matlack Date: Wed, 29 Oct 2025 13:43:56 -0700 X-Gm-Features: AWmQ_blzsfm8AU4aSmOo38Baxqd-QolYtNvPxHfj3yJKEB0u3KTJVZdMqBMfTX4 Message-ID: Subject: Re: [PATCH v4 14/30] liveupdate: luo_session: Add ioctls for file preservation and state management To: Pasha Tatashin Cc: Pratyush Yadav , jasonmiu@google.com, graf@amazon.com, changyuanl@google.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, lennart@poettering.net, brauner@kernel.org, linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, saeedm@nvidia.com, ajayachandra@nvidia.com, jgg@nvidia.com, parav@nvidia.com, leonro@nvidia.com, witu@nvidia.com, hughd@google.com, skhawaja@google.com, chrisl@kernel.org, steven.sistare@oracle.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Oct 29, 2025 at 1:13=E2=80=AFPM Pasha Tatashin wrote: > On Wed, Oct 29, 2025 at 3:07=E2=80=AFPM Pratyush Yadav wrote: > > Also, I think the model we should have is to only allow new sessions in > > normal state. Currently luo_session_create() allows creating a new > > session in updated state. This would end up mixing sessions from a > > previous boot and sessions from current boot. I don't really see a > > reason for that and I think the userspace should first call finish > > before starting new serialization. Keeps things simpler. > > It does. However, yesterday Jason Gunthorpe suggested that we simplify > the uapi, at least for the initial landing, by removing the state > machine during boot and allowing new sessions to be created at any > time. This would also mean separating the incoming and outgoing > sessions and removing the ioctl() call used to bring the machine into > a normal state; instead, only individual sessions could be brought > into a 'normal' state. > > Simplified uAPI Proposal > The simplest uAPI would look like this: > IOCTLs on /dev/liveupdate (to create and retrieve session FDs): > LIVEUPDATE_IOCTL_CREATE_SESSION > LIVEUPDATE_IOCTL_RETRIEVE_SESSION > > IOCTLs on session FDs: > LIVEUPDATE_CMD_SESSION_PRESERVE_FD > LIVEUPDATE_CMD_SESSION_RETRIEVE_FD > LIVEUPDATE_CMD_SESSION_FINISH Should we drop LIVEUPDATE_CMD_SESSION_FINISH and do this work in close(session_fd)? close() can return an error. I think this cleans up a few parts of the uAPI: - One less ioctl. - The only way to get an outgoing session would be through LIVEUPDATE_IOCTL_CREATE_SESSION. The kernel does not have to deal with an empty incoming session "becoming" an outgoing session (as described below). - The kernel can properly leak the session and its resources by refusing to close the session file.