From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f49.google.com (mail-qv1-f49.google.com [209.85.219.49]) (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 6096937188B for ; Wed, 3 Jun 2026 12:05:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780488308; cv=none; b=KKmTxBcga7b+dvHyv3RfuFAC0I1IZuJS1kAAaFBxKATicECnkxtg6iz6k/NvoGZRb5VdiulMlrL0UuxIVZibOGZn436hIpP1yjcuyLbdSt9KeI7HOwPerRQenbR4ZelUGazCXZnnH2i2uKLUjVaKFnZ55/nBtiPKo/4nK5asrvY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780488308; c=relaxed/simple; bh=OwDhAFJOHEAGx56sW7AtIsSE/hkAKo5OcDReMvQULCk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sai3A1dawx1QQLjL2szwB5cV1d7M18UYotu6WRJa6s9K8LuTpdbMeIeTsqvwySKRJ+NR2mPR8GesR0Yym4k+qlkXgRLess1JISGCsrMNob1MZoeL7FYaisrcCZRE0I5pgqLDqul5bgIng+pEhYn3d5lpp0scpjlV9IPeZ4WGnTg= 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=hKOpIF7d; arc=none smtp.client-ip=209.85.219.49 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="hKOpIF7d" Received: by mail-qv1-f49.google.com with SMTP id 6a1803df08f44-8ccf01ba514so37099896d6.0 for ; Wed, 03 Jun 2026 05:05:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1780488306; x=1781093106; 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=1X7rdmAsUUmk8fm1lXinqRbOJ2Rb1qcFGzfHrd7zSSw=; b=hKOpIF7dorP9INndDLGyuKFBdaPFKloZkTRRB0pBhfXg5RJmiLvCh9x/se1CqXJW18 e37iAYfiHVClUE1Qql0WqJoWyb1iRb1tFPr0ng78fisDFVJ/2VF/akwMTWLjRATEmRzn PFFUQNdOT7BVZMOQU7g3N9tv0dh7QgF27ZZPzcSsTWF5UiVtZ2akkk8hqfKMcbuZ3IBr 0Pc3lecr/7TcnnDm6hSGWSAwApZAOS9v0pT1FS57oEk3+3lHjErXXeBTOTnzjqBisARG I1BdZkqrBrLUPhHoWq5cmRRqCq2EZoOLPC2iSQVUNjW0txoFuLaQtc31ZTkAH5WFSZE+ bLwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780488306; x=1781093106; 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=1X7rdmAsUUmk8fm1lXinqRbOJ2Rb1qcFGzfHrd7zSSw=; b=P5/RBHJWoGuYbMvY0GxBchEfpq0BgiLZS7i9W2ZsvpmIMqZ/NHlvc/uoyZQqflUz+Z wvBjBPv3GHi4INPZEKvVnySEn2BpowON1Fkc/kVhKLvVCavtofBgaPMcBgfEJW2iehc6 HqY/DV7zUdAdrL0bTrL1p+02mXcwCEv94hIyqurLjT6Bmlx9Obgy35IOurnYrS6LdBMa EO3zuE2irQZxU7MJcBUdmyXSq68VB4YQW4CUROuZXza4t3amdGN2TdQmcL2pL0ICDwHp 9P0K06rJJUuVpJUoqmrD+jOQxXuRuv22UsxS2zles4Dci02k3NBK4K4XTdVt1kP7Luez CvgA== X-Forwarded-Encrypted: i=1; AFNElJ9+pbf6bZzYlhCMmwXoI+qEyezE4z66xzdNPuTmOxDnGHo6pVgayc+jWTJRUJU8262IZLzwmdsrOlUO7Vs=@vger.kernel.org X-Gm-Message-State: AOJu0YzAcBi4YeYzLNEnb/dEAMLR7i6j0IPvXWUgkABEQzVSjPc6aDEi VYlpfLrlf98cZIvjgpUrRdqiaUaTQAITgtRffhbGj9l1MN2MHTyGFIT+fBWSSk4gLWMOdhihy+/ 1Vwmd X-Gm-Gg: Acq92OG2j6NLF1Yk1JSwVBlr8CwBjA4kWiSEeRpW6jrkjSFNNtttcIvcWOsum/6OwnA HeBGR+VCPk3jO8alfzFjbO8CBVLTalAHV+zlGHssFSrU+4hRsuXJWIC9O82HCTXlSDfrPfDBdTE vi7IJFCv68Ueyz0c8auVZ9yskoMfxr2l3GlsOe+W3CrElsxbzF1Ne7W1AW4bZJzXXIowzxTiStr P8xd0mcahhSKd2MGSty3mGgku6x4MFom2gfy0GFv2W17Ej9KhQlcXmzJlIlJfGYAkADQZ9eejOH qlWgWkYlDX4PVQ4eUYS3wUv7O5mIrLQ5kcilFzVD060iEpFZvi8UuUk82/AJOI/ZRktIwKzKyy/ Hp4kJIrUtrh8aBa0wa+kqhipFclu/WHAU9m04EAJ0DzVjTx3iIecC0FGqwjpz3j24P79FjuHvj+ g3u/RCFpCPtfkXcaqlATvBie5X20BXbjGaxS2PsID79GeJ9dTfGVQnrgCoIHJydg== X-Received: by 2002:ad4:5851:0:b0:8cc:f012:f42c with SMTP id 6a1803df08f44-8cecdc09461mr34569126d6.6.1780488306396; Wed, 03 Jun 2026 05:05:06 -0700 (PDT) Received: from plex ([71.181.43.54]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8cecd2682f8sm18054716d6.43.2026.06.03.05.05.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 05:05:05 -0700 (PDT) Date: Wed, 3 Jun 2026 12:05:04 +0000 From: Pasha Tatashin To: Mike Rapoport Cc: Pasha Tatashin , linux-kselftest@vger.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, pratyush@kernel.org, skhawaja@google.com, graf@amazon.com Subject: Re: [PATCH v6 07/13] kho: add support for linked-block serialization Message-ID: References: <20260603032905.344462-1-pasha.tatashin@soleen.com> <20260603032905.344462-8-pasha.tatashin@soleen.com> <178046937151.468621.13398573538792303093.b4-review@b4> 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: <178046937151.468621.13398573538792303093.b4-review@b4> On 06-03 09:49, Mike Rapoport wrote: > On Wed, 03 Jun 2026 03:28:58 +0000, Pasha Tatashin wrote: > > diff --git a/include/linux/kho/abi/block.h b/include/linux/kho/abi/block.h > > new file mode 100644 > > index 000000000000..8641c20b379b > > --- /dev/null > > +++ b/include/linux/kho/abi/block.h > > @@ -0,0 +1,56 @@ > > [ ... skip 25 lines ... ] > > +#define _LINUX_KHO_ABI_BLOCK_H > > + > > +#include > > +#include > > + > > +#define KHO_BLOCK_ABI_COMPATIBLE "kho-block-v1" > > It's never used by block set and after looking at the following patches I > found that it's appended to LUO compatible string. > > While this works for LUO, I think it should be kho_block_set_restore() > responsibility to verify the compatibility. It should work for any component that relies on kho_block. My proposal is to use this method for other common KHO data structures (e.g., kho vmalloc, kho radix, future kho xarray). There is no need for them to carry the compatibility string in their metadata, as whoever uses them will include their compatibility string. For now, reviewers will have to make sure that if the ABI header content is changed, the compatibility string is updated. > > diff --git a/kernel/liveupdate/kho_block.c b/kernel/liveupdate/kho_block.c > > new file mode 100644 > > index 000000000000..4f147c308e6b > > --- /dev/null > > +++ b/kernel/liveupdate/kho_block.c > > @@ -0,0 +1,411 @@ > > [ ... skip 121 lines ... ] > > +/** > > + * kho_block_set_grow - Expand the block set to accommodate the target count. > > + * @bs: The block set. > > + * @count: The target number of valid entries to accommodate. > > + * > > + * Acts as a runtime notifier when new resources (such as files or sessions) > > Not sure I understand what "runtime notifier" means in this context. It came from discussion with Pratyush, but I think we are on the same page what they are, and I will just remove this. > > > [ ... skip 11 lines ... ] > > + > > + while (count > bs->nblocks * bs->count_per_block) { > > + int err = kho_block_set_grow_one(bs); > > + > > + if (err) > > + return err; > > This leaks memory if more than one block is added. > > > [ ... skip 31 lines ... ] > > + * unregistered, allowing the block set to release and unallocate redundant > > + * preserved memory blocks. Checks if the last block in the set can be removed > > + * because the remaining entry count is fully accommodated by the preceding blocks. > > + * > > + * Note: It is the caller's responsibility to ensure that entries are removed > > + * in LIFO (last-in, first-out) order (the reverse order of their insertion). > > I think "in LIFO order" is sufficient :) Oh, I keep removing those :-) > > [ ... skip 173 lines ... ] > > + it->i = 0; > > + } > > + > > + entry = kho_block_entry(it, it->i++); > > + it->block->ser->count = it->i; > > + return entry; > > This looks way better than the previous version :) > Thanks! Thank you. I will send a new version of this patch as a reply to this email to avoid cluttering the mailing list. Pasha > > -- > Sincerely yours, > Mike. >