From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.216.48 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794330446; b=n0WvNxrLpdtceAkINRdu/IuIwXe9W1EsoXptZqys80SY2UTjGCbYEkayV/cAg1kRzC7g c00bzMngRbMhudaUOTXP87n+Iws8rfjl5cZw76zA27RUiBwBdedjUJ/l8fd3RN+SFty4z nfyUL8MjWU5rOeCWMQufYDdbBMnfU2bIZIuLoyST7EVphPD9+YR050C+7iUrcEdNGVml6 PU/g5nJcZ/BpJ3if6ZXHSTWS/LIfkULubXEnxIXERg0AtJLCBZe818KfbKOtPIN9+4bXZ 5+9pJxdOFWiRRCHtHCGJenyZFNPJu5Rk6Xu4Zt8hTfFnndw438Mlq22fzPU8T0xSsmw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794330446; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Mime-Version:Content-Transfer-Encoding:Content-Type:Date:Message-Id: Cc:Subject:From:To:X-Mailer:References:In-Reply-To; bh=FNcC9m18UoMJxRcJEPoSUxoKZdU2fxVY/XU8PXnrjcA=; b=JPTEmTY5s7U9ypPcke2KvJU9HHgZuxuQN8CifPwGe800QoI4G2fSlgBqLbjzaKKScmxY Sxwwg4od1HyDsmTbpiOTYW3B53CY+uaztAjiOm5KDsCECD9eLwN4iRgTodSXz/pvqU6B1 I9jjWCJHpp4mYBp6qsyeR9SadaOuTp9dN2p3Fx9FSHETLWdTcXMlJQsGCSFj4+hs4f4Ad ZqBrLkdANVGXY0/oicza+jcF3WsuUEgDnKhFXXTDAqvC9hXVmsAH7RSeKYfBUQF1Xj4SJ FZCWDAohHsPv/0FGKmDkhTHpaYzuW7GNJpADt2KFaH2ayvVs/KmNSFeOGOGi9h9izdQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=Ll0+Kvxx; arc=none smtp.remote-ip=209.85.216.48 Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1913A606A31C for ; Tue, 10 Nov 2026 17:07:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1913A606A31C 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.a=rsa-sha256 header.s=20260707 header.b=Ll0+Kvxx Received: by mail-pj1-f48.google.com with SMTP id 98e67ed59e1d1-3b09c07b3d2so1438967a91.3 for ; Tue, 10 Nov 2026 09:07:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1794330445; x=1794935245; darn=lists.linux.dev; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-type:content-transfer-encoding:mime-version:from:to:cc :subject:date:message-id:reply-to:content-type; bh=FNcC9m18UoMJxRcJEPoSUxoKZdU2fxVY/XU8PXnrjcA=; b=Ll0+KvxxI+7IeuvplIdz7eSwRx9j+HljixU6YOayzTVMwxQLQ8B3ghkMFHsbrdJU0Y wTNjyow+DEOpLOct+X+4JaPEZAf6eVTLywqpyMGTmm88DyLbrzyFaalcvZTaKxweKqe4 1UeB/grNPGGNPji2RaXwJldNfGK7Nx+llFCxh2zpqfJ5WtUhEC08M7+5X6lDgBnG0NiL YmDItt6FK+r35cWntGxVz9MKTCtwJh0anmThSHOGMBs5x3BXTjK9PijI6u+Z6PRdb1LF j9MXcdXSx3Fy5RR+U/WIf4XQ5EJqDgJmttceBaq4W8IPNKItDGigLOSmOrHexY3detaW t3qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794330445; x=1794935245; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-type:content-transfer-encoding:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=FNcC9m18UoMJxRcJEPoSUxoKZdU2fxVY/XU8PXnrjcA=; b=bm7xEf61PtMqUPEvulIlWAQ+yvsu4TQMdarFOpGzdZUWDdhG3Mtb/pVydf1duHGr6v 7FITyp+5a0SVLh62FmJqgrEyQtR40GDihE9S3daFXOa8O+UMu1SUcWwMA/yg0A1T+4w3 +70PX59XjWGpUGSql0Z23XztNhtJtIL1x88ExjkdQvDt7Yau1FfTcwFmsogits5pFDML EWjVYMmC66h+RUkhfTAT+JPUCssfmw1esK0a+VM7seITDTMAKGNEw6QErjp8o3iXDj+g flAbW0MzknDq6AsSkaRsKvmkucr6J8WCbxlUcx+7YG1RRUto2ynSiar8doIexD7ItBv2 RbEQ== X-Forwarded-Encrypted: i=1; AL+hErFuRJre1l4eTxe1VOZzxKJLWbwEqscHc1NlLfZQliLsKA4HbJTNVAa9Cawl7Hp+a9sVr6MZrw==@lists.linux.dev X-Gm-Message-State: APuU4Z/DMh5RYPEV6RK/S9QGmjOjLZUS45TFs17jtBXkQpab60GdqPSf LQAICBNd1DyQB26i964qCN9CTEz9ewK3ZWfLOuB8LzW4wpI/XjhUUNPMFS0EUrrOWA== X-Gm-Gg: AYBFou3e09e4r2vYLuXF+UqeMv6rRiGg021sNlSiUmjez+U7P8PxwiEBj44BFwmoFhw o3B6qTki30bpbjjp7TJv/PdI4rEuZ+hC7qj7NC96ZcAztDJ1cuXCk6aDprgZBCtfhDwwuhbNOhh K6kPvlUZGmObH+c6sXQu/qydL6EqajlEXMQRW47hsXmcZMkSW1ATX9LwKibH4zUqDS43P9o2Lvb FTeL3JvUj+05xTwiO2/jMdF3K8W+PJDY4u2NoEUzYz4FtyEL+HYx3/RnPJSAWAcfRwlWxoQ1Aiy n89JIqSmx7odUYPQFB6OF3CWIukaKl/UQH4bbaiMbREMl8gFVFS4KYMWnBE2PQRMg1CQOEPBgAQ UKSZsMaIu00fHFUjwFvDXxCJIoqPpuc551OvX65bi3VpPY1jkpOzJKOHatsCD225ugxtyNeIghl l0j9t3h8IMinHUsPjQ9gpb/Xzt4P6BfqdJBs53hH7SELVjrlflj9Ss6X0gLGLHlLPvooH13ZIN6 b/Kgf/e0oVYWscJtVx/MMZ4OVZ0CXHNo2oD9u6jnS+54ec4SX7YMlqUhbd6TpGMUiBg5WRhNSdQ eOHePrGAjoGAlRMk33TOM/DNOwrsghL8l3pABXcDuvuzgfxzzw2lhQYCXbowuoPS X-Received: by 2002:a17:90a:e7c1:b0:3a5:133:ca5f with SMTP id 98e67ed59e1d1-3b166cdb54amr3659496a91.46.1794330444574; Tue, 10 Nov 2026 09:07:24 -0800 (PST) Received: from localhost (33.79.127.34.bc.googleusercontent.com. [34.127.79.33]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b17db56c7esm499973a91.8.2026.11.10.09.07.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Nov 2026 09:07:22 -0800 (PST) X-Mailing-List: iommu@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 10 Nov 2026 17:07:22 +0000 Message-Id: Cc: , , "Pratyush Yadav" , , , , , , , , , Subject: Re: [PATCH v4 08/19] kho: block: Add the feature header to blocks From: "David Matlack" To: "Tarun Sahu" , "Pasha Tatashin" , "Mike Rapoport" , , , , "David Matlack" , "Alexander Graf" , , , , , , , "Bjorn Helgaas" , , , , , "Andrew Morton" , , X-Mailer: aerc 0.21.0 References: <20261110050202.529473-1-tarunsahu@google.com> <20261110050202.529473-9-tarunsahu@google.com> In-Reply-To: <20261110050202.529473-9-tarunsahu@google.com> On Tue Nov 10, 2026 at 5:01 AM UTC, Tarun Sahu wrote: > Precede struct kho_block_header_ser with struct kho_ser_hdr using > DECLARE_KHO_SER. Each block in a block set starts with struct > kho_ser_hdr followed by struct kho_block_header_ser. Serialized entries > start immediately after the header payload at offset fhdr->size. This adds a feature header to every block in the set, but the layout it describes is a property of the whole set: all blocks are written by the same kernel with the same header. Blocks are only ever added and removed at the tail, so the head block is stable for the lifetime of the set. I'd put a single set-wide header in the first block only, e.g. a struct kho_block_set_ser with its own feature header, and keep the per-block header to next and count. entry_size (added in patch 2) is another set-wide property that belongs there. All blocks in a set have the same entry size, so recording it in every block is redundant, and restore has to check that the copies agree. [...] > entry_size =3D ser->entry_size; > bs->entry_size =3D entry_size; > - capacity =3D (KHO_BLOCK_SIZE - sizeof(*ser)) / bs->entry_size; > + capacity =3D (KHO_BLOCK_SIZE - fhdr->size) / bs->entry_size; > bs->count_per_block =3D capacity; Nothing checks that the blocks agree. Each block's entries start at its own fhdr->size, and count_per_block ends up being whatever the last block implies. With a single set-wide header this can't happen.