Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.218.72 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796200373; b=tmcYpDt0FY/6KQnufgxX7ut/5tIxU0xuA5/J7mjDWMmUfnWl2YFVk2GEmyWCQ4G4q7n7 zGXK8Cf4JGC7frTe2o9kPfRHx1002zEkT31zuna1sHuxY7wMYxi8Ist8NCr0qtMjNiK48 rKsYXL3GecNZsSva+Qv7LQLZ3wXYj5n5oyiGUrSiqEg7lJYrB2wah1nybiwStDMYhzBcJ rR3UqzdY0Vn5pboBzzB2UuzlA5TgNtAokJmfvhFBS8qEbXX2veeuIqDNezzrCJh+kOC8q YHYl/TVIjP3yztcSmW1K5FmIhysf2FqnsiAMn4a4vIYEZglbSz7LIHxmviRg8qVzWMg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796200373; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:Date:In-Reply-To: Mime-Version:References:Message-ID:Subject:From:To:Cc:Content-Type; bh=kpsSYU0K8zEDXvoeBsIeQZieWyIbBMD35jFmVCJ9P6w=; b=m9hBSaSES44KE8HXwgIy4rcoT7U6EPg4oPJ6TIjh3CdW/EdofVh/4D1WBnFgYwsXTVWr k7bpcO2BJqSAQOOiuZE3DTQ1fK0Vr/nrmXiLGd6ja5ilcZSwlGSJBjzZ/y3lL8jjeXbbv SqdXRuTwumfjeid7XUcxDs0yKaRPHnm//mTM5lTwNmCbiZBvE+UOMrnUXy8klqKprbrC5 z/Svi4jmKECrXzjb0RdX8TSC5M6kOk9usOqhJ5FVB+mU8vqnFtW9AlABviVzgJu1cLizD qfdm7cR91oh8KuBpawnXsMJKuVmeXzqC0zzxxXCQN2GyjCwewaNsaJZZ+/7QUcY3jUA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--tarunsahu.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b="fmqfBAq/"; arc=none smtp.remote-ip=209.85.218.72 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (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 ED5BE606A330 for ; Wed, 2 Dec 2026 08:32:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org ED5BE606A330 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=flex--tarunsahu.bounces.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=fmqfBAq/ Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-c508f61e492so933933566b.2 for ; Wed, 02 Dec 2026 00:32:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796200371; x=1796805171; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=kpsSYU0K8zEDXvoeBsIeQZieWyIbBMD35jFmVCJ9P6w=; b=fmqfBAq/lFlkNqZZREW87ZRwGNdJ/3opgoQWc0i/4EIs4StZRAidXe+7oEodeeVvOs JDnAfOL9TTsm1CaBNLnWCCOteQiG6CF1ZnjEfLhXzDGLQ//G57qN/g9974LZ+7dQgBBn wE9yt8DOyKpYKxp76jxgZtftEs1pE1tm/ZdhX2DS9yifDTl5ZGKG/IQCaI5pf5wbnmrZ UlE7O6RDfrEYL3U1DuIz0zqvHJC7O2hJZha6uY+HYXSCX7k3Vnkg/3g3a0Z2BeatJS8y 6NQdStRWxTMPRU6mksdcdU0NiOavDIPgwWG/XaqYi2EPe0mMQPnoLFZrRP6KPZPGw6uL ikTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796200371; x=1796805171; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=kpsSYU0K8zEDXvoeBsIeQZieWyIbBMD35jFmVCJ9P6w=; b=xwtF0qyk60HhwSbdg3mdZQzLdV1kY3+BcQP/+W19Hg7yNuQV6xsbyyL/8qTiBqBylT Xd7sNbGz8XepWSDHdguQMZaVy7k7Cgm8HkdbQpqUt5IaSV09thcM3mFKhX3fyltMzGRx c5GDvfGRarYT7qkDRqE+I0OjiCKF8LPSFP7L6oESwO31AH9WuS710aMzB2zzRlTmlcdU Bu8o+NjhKGKe7e8Im9h3PNgheRAZwQQmg6S7XwisSppKecYoQSt7AcMjX3I6RXRWS3Vy I60IMrnEOF9kyMt8pLn71S0M1Cxzw+dFXZ+GVP15uDi3m+59bPVxj/iFWS322gKP5r6o oi1Q== X-Forwarded-Encrypted: i=1; AL+hErENTCp8czf4f40N2/hAxdQ+bgDocuowB9+4FthfS5BCtwgbeQoczLx/vYquSvg3rAkiO6c=@vger.kernel.org X-Gm-Message-State: APuU4Z8iQ/b98vB4qpoZJ4RWgcRaq8g7o00dN5kgKE18R35IG1AC/AzC /gKltsZxcwAJ+SA/+FH/OMEy3DBklPLreZ52NkLiwdzSMAUsIzNI1dHEEkg5dTuEacYhM4bZnqh beYS4fztbtIZ3aIU+hQ== X-Received: from ejq13-n2.prod.google.com ([2002:a17:906:418d:20b0:c50:db6d:bc64]) (user=tarunsahu job=prod-delivery.src-stubby-dispatcher) by 2002:a17:907:6ea8:b0:c51:3bde:bfd0 with SMTP id a640c23a62f3a-c513bdec070mr3323425266b.47.1796200370925; Wed, 02 Dec 2026 00:32:50 -0800 (PST) Date: Wed, 02 Dec 2026 08:32:50 +0000 In-Reply-To: <2vxzcxrrwjsv.fsf@kernel.org> X-Mailing-List: kvm@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 References: <20261110050202.529473-1-tarunsahu@google.com> <20261110050202.529473-9-tarunsahu@google.com> <9huzse13pxhq.fsf@tarunix.c.googlers.com> <2vxzcxrrwjsv.fsf@kernel.org> Message-ID: <9huzse0g3wwd.fsf@tarunix.c.googlers.com> Subject: Re: [PATCH v4 08/19] kho: block: Add the feature header to blocks From: tarunsahu@google.com To: Pratyush Yadav Cc: David Matlack , Pasha Tatashin , Mike Rapoport , robin.murphy@arm.com, maz@kernel.org, will@kernel.org, Alexander Graf , seanjc@google.com, jgg@nvidia.com, loganodell@google.com, arnd@arndb.de, dwmw2@infradead.org, baolu.lu@linux.intel.com, Bjorn Helgaas , oupton@kernel.org, alex@shazbot.org, gle.com@google.com, pbonzini@redhat.com, Andrew Morton , kevin.tian@intel.com, joro@8bytes.org, kvmarm@lists.linux.dev, linux-pci@vger.kernel.org, Pratyush Yadav , kexec@lists.infradead.org, kvm@vger.kernel.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, skhawaja@google.com, sagis@google.com, linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Pratyush Yadav writes: > On Sat, Nov 14 2026, tarunsahu@google.com wrote: > >> "David Matlack" writes: >> >>> 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. >>> >> >> Yes, adding a ser_hdr to each block_header is unnecessary and also cause >> 8 bytes to get added to every block. This can be solved like you said by >> adding it only to the first block. But this will make number of entries >> in block[0] to be less than blocks 1..N. I am not sure if that is >> acceptable but if it can be then we can avoid adding ser_hdr to each >> block. Same for entry_size which can be moved to the first block only >> like you suggested part of struct kho_block_set_ser. > > I think it is simpler to do as kho_vmalloc does and just have a separate > out-of-band structure to hold all the metadata. Right, I will implement this in v5. Thanks > > [...] > > -- > Regards, > Pratyush Yadav