From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f172.google.com (mail-yw1-f172.google.com [209.85.128.172]) (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 87E293BFE31 for ; Mon, 1 Jun 2026 14:44:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780325057; cv=none; b=nI3fbwstBobrdfA6QPcnndPWhpFu/AcMNBad1u1StK39vRettYb8GrwA+lWkYpox2MgYwDSEvCezBIQxTr7po0FmezsiumRmwnCdfO7kcgfQc2xmDK49VqAWqy8zBEkYy6T7IUr9A8+VXnAWdW46RofgHgkTZE5GQAlm09hSWvk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780325057; c=relaxed/simple; bh=0/6PPPczUPstqdeXFmlTfi2ZpOlCRrU6ph2Il3cBxlA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XzAiMPsbW8YoYbTVue88ly4i/PBvYLybZJc1PKg3nUnPne6rLvsTvkkWd31+cp4E3BZcD9RepjK1aYVzTTCfnWDZSejcZcSga3Cb0+lbpLKZbI559IoqxMyKBqPkPDsXAfWHXRjNMLduyz+zQZpPSy3PFEEBHwcgel5X5s5ykTo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=soleen.com; spf=pass smtp.mailfrom=soleen.com; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b=I7VK568K; arc=none smtp.client-ip=209.85.128.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=soleen.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=soleen.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b="I7VK568K" Received: by mail-yw1-f172.google.com with SMTP id 00721157ae682-7dc6d090381so50516217b3.2 for ; Mon, 01 Jun 2026 07:44:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1780325055; x=1780929855; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=GHCECJLKZVXmKAb51dyXN6SjQcWAQtdhT5+Tc3oFsbc=; b=I7VK568KcEwbosq/EbTGcWrIWERYiWOyjDcOq3m3698R1hXs+AhVn11WSLYA7hAZqU 5xCYlKtdJnsx2pxxV6MyphNf449+AoQfu5UTEp4axbZ7n35baxn3uA10sM5sNGkhi/uW SfNSqfMCRuiaYIWdla//HzfOK0w2STY9106SXjsLmds6NdpTHabCk//lVzT9soZ0Lset YxUpeIQ94rHYEJGRqE/SgRbtUhrqKqWgZCg8t5D3LHvsVZACfKtyOOWxW+tf5/BpUMIX xx60JO0o3ZgA/Yfyi9Ge/eikZOTFow9f8aFOhFrhAY7pa0ll6E5J6HIWIMPUCvkt9c0f uh0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780325055; x=1780929855; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GHCECJLKZVXmKAb51dyXN6SjQcWAQtdhT5+Tc3oFsbc=; b=WiBWIlM5PN2rVHniVwGcbBFpZqEdXPAUrR7E5YQgbCRCv12riZoHKnrsbqReBd+h9m YdTiUmbqoivaEd+yUFSZP6WeSWB/iCYjedG1IErmnkqTaGxZqUEY+y/In5XW5RbJAk9z SRSHjzfhABCoSFdo43mf/Plaa2gigOmsS4B/VNc32+Lo8S6EaRzFWQJyeQUuIqlNjA4U oz0BRSh9VmiotC+luOCNQzB61hHn+kDxKhyaUScVplXGOybDMyc8MmmD+t2cgYRDXYSh fIsa+Ke5J4bNokaJjn3w8MDFFd986+DdedL3/djpmrqr5T1YWchG3vOygEiiN+d/QPcW vyIQ== X-Forwarded-Encrypted: i=1; AFNElJ8PoJyw85vxmYhxFRappiHNEfOv0+xnHKLLeBEEobER35vY2tpE3MA2Q0pb0muV9u/llzILwKcHp/Ju+Aw=@vger.kernel.org X-Gm-Message-State: AOJu0YzKpcniFcn2Fsel/voaMbCK3FyYbVoqB2r03QAI/2csiwcTqndq 24GqHEGX6yyj/2oooR+HfwyHf56uYHHM1GxfAIc+H7gQw+/tJ/Y/A8xcXgp7unYjxMQ= X-Gm-Gg: Acq92OFM9aj7KFdf1AjpnBJG4URfahCGGGlO4uNMKAmnWnNw6wAxqH1KvwiZem5wlT6 qk9n2iaT3yIRpcQjw+GjOof/sEagmg+zHZDR3Jn6dA76ptXDPT4LXuSUVyQhgNPyGHOhiIeTlTr i/YPTccmG9C0yg/xbrNtj28eRSkpEHASAtNloMefCuV/xQNMIqrc4n4z32OSSCpG+3/iaHZRs1k JUX+5mHnQJ9H/xT0WKywhTerdcguQxIoaLmH82Lv89NJ3U9nL/GeBh/iDIaBuBAY0l8xDz8d8s7 U/pVUcPfE+Zob7D/4mOjDJ4Ha0SZqb9/QSzDwJJOgsOe8RjQh4fJyiZoddNS9OdgGZwxvsKh5Ra FP6DpO+9wJ6HJYaTwtwTgc0qQrnxYGc0fqri3KQvKs8pjwTR7W2wxNcU8I0/h2lp7IkkyEl/uqd mRiggkhED3mSMs08AB1WU6ccet5AovJO6TXAhm6RAw0CRoReXsEH4lys2KVSmusFkquNdRlWmU/ 3nONiqn5RS95QEWSd8WQrtOkmFqqRKaNK0OoXET8+YxpdwMU8AMLQ== X-Received: by 2002:a05:690c:3511:b0:7dc:e580:7f8 with SMTP id 00721157ae682-7e05d0172d6mr107595267b3.26.1780325055588; Mon, 01 Jun 2026 07:44:15 -0700 (PDT) Received: from google.com (138.200.150.34.bc.googleusercontent.com. [34.150.200.138]) by smtp.gmail.com with ESMTPSA id 00721157ae682-7e17c9ac78asm41186257b3.43.2026.06.01.07.44.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jun 2026 07:44:15 -0700 (PDT) Date: Mon, 1 Jun 2026 10:44:14 -0400 From: Pasha Tatashin To: Pratyush Yadav Cc: Pasha Tatashin , linux-kselftest@vger.kernel.org, rppt@kernel.org, shuah@kernel.org, akpm@linux-foundation.org, linux-mm@kvack.org, skhan@linuxfoundation.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, corbet@lwn.net, dmatlack@google.com, kexec@lists.infradead.org, skhawaja@google.com, graf@amazon.com Subject: Re: [PATCH v4 09/13] liveupdate: Remove limit on the number of sessions Message-ID: References: <20260530221938.115978-1-pasha.tatashin@soleen.com> <20260530221938.115978-10-pasha.tatashin@soleen.com> <2vxzfr36fjcj.fsf@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2vxzfr36fjcj.fsf@kernel.org> On 06-01 16:03, Pratyush Yadav wrote: > On Sat, May 30 2026, Pasha Tatashin wrote: > > > Currently, the number of LUO sessions is limited by a fixed number of > > pre-allocated pages for serialization (16 pages, allowing for ~819 > > sessions). > > > > This limitation is problematic if LUO is used to support things such as > > systemd file descriptor store, and would be used not just as VM memory > > but to save other states on the machine. > > > > Remove this limit by transitioning to a linked-block approach for > > session metadata serialization. Instead of a single contiguous block, > > session metadata is now stored in a chain of 16-page blocks. Each block > > starts with a header containing the physical address of the next block > > and the number of session entries in the current block. > > > > Acked-by: Mike Rapoport (Microsoft) > > Signed-off-by: Pasha Tatashin > > --- > [...] > > @@ -63,13 +58,15 @@ > > #define _LINUX_KHO_ABI_LUO_H > > > > #include > > +#include > > #include > > > > /* > > * The LUO state is registered under this KHO entry name. > > */ > > #define LUO_KHO_ENTRY_NAME "LUO" > > -#define LUO_ABI_COMPATIBLE "luo-v3" > > +#define LUO_COMPAT_BASE "luo-v3" > > +#define LUO_ABI_COMPATIBLE LUO_COMPAT_BASE "-" KHO_BLOCK_ABI_COMPATIBLE > > That's clever :-) > > [...] > > int luo_session_serialize(void) > > { > > struct luo_session_header *sh = &luo_session_global.outgoing; > > struct luo_session *session; > > - int i = 0; > > + struct kho_block_it it; > > int err; > > > > down_write(&luo_session_serialize_rwsem); > > down_write(&sh->rwsem); > > *sh->sessions_pa = 0; > > > > + kho_block_it_init(&it, &sh->block_set); > > + > > list_for_each_entry(session, &sh->list, list) { > > - err = luo_session_freeze_one(session, &sh->ser[i]); > > - if (err) > > + struct luo_session_ser *ser = kho_block_it_next(&it); > > + > > + if (!ser) { > > + err = -ENOSPC; > > goto err_undo; > > + } > > > > - strscpy(sh->ser[i].name, session->name, > > - sizeof(sh->ser[i].name)); > > - i++; > > - } > > + err = luo_session_freeze_one(session, ser); > > + if (err) { > > + kho_block_it_prev(&it); > > + goto err_undo; > > + } > > > > - if (sh->header_ser && sh->count > 0) { > > - sh->header_ser->count = sh->count; > > - *sh->sessions_pa = virt_to_phys(sh->header_ser); > > + strscpy(ser->name, session->name, sizeof(ser->name)); > > } > > + > > + kho_block_it_finalize(&it); > > + > > + if (sh->sessions_pa && sh->count > 0) > > Nit: Why check for sh->sessions_pa? It can never be NULL. Good point, I will remove it. > > Other than this, > > Reviewed-by: Pratyush Yadav (Google) > > > + *sh->sessions_pa = sh->block_set.head_pa; > > up_write(&sh->rwsem); > > > > return 0; > > > > err_undo: > > list_for_each_entry_continue_reverse(session, &sh->list, list) { > > - i--; > > - luo_session_unfreeze_one(session, &sh->ser[i]); > > - memset(sh->ser[i].name, 0, sizeof(sh->ser[i].name)); > > + struct luo_session_ser *ser = kho_block_it_prev(&it); > > + > > + luo_session_unfreeze_one(session, ser); > > + memset(ser->name, 0, sizeof(ser->name)); > > } > > up_write(&sh->rwsem); > > up_write(&luo_session_serialize_rwsem); > > -- > Regards, > Pratyush Yadav