From: Jason Gunthorpe <jgg@nvidia.com>
To: Pratyush Yadav <pratyush@kernel.org>
Cc: "Alexander Graf" <graf@amazon.com>,
"Mike Rapoport" <rppt@kernel.org>,
"Changyuan Lyu" <changyuanl@google.com>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Baoquan He" <bhe@redhat.com>,
"Pasha Tatashin" <pasha.tatashin@soleen.com>,
"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
"Chris Li" <chrisl@kernel.org>, "Jason Miu" <jasonmiu@google.com>,
"David Matlack" <dmatlack@google.com>,
"David Rientjes" <rientjes@google.com>,
linux-kernel@vger.kernel.org, kexec@lists.infradead.org,
linux-mm@kvack.org
Subject: Re: [RFC PATCH 1/4] kho: introduce the KHO array
Date: Tue, 9 Sep 2025 12:28:14 -0300 [thread overview]
Message-ID: <20250909152814.GL789684@nvidia.com> (raw)
In-Reply-To: <20250909144426.33274-2-pratyush@kernel.org>
On Tue, Sep 09, 2025 at 04:44:21PM +0200, Pratyush Yadav wrote:
> The KHO Array is a data structure that behaves like a sparse array of
> pointers. It is designed to be preserved and restored over Kexec
> Handover (KHO), and targets only 64-bit platforms. It can store 8-byte
> aligned pointers. It can also store integers between 0 and LONG_MAX. It
> supports sparse indices, though it performs best with densely clustered
> indices.
That is a bit of an understatement, it looks like worst case cost is
4k per entry. I would expect better efficiency than this if we are
serious about supporting sparsity..
I think you need to encode the start pos within the entries in some
way so worst case cost is bounded to more like 16/24 byte per entry.
For instance if the page was broken up into an array of structs like
struct entries_block {
u64 flags:1;
u64 num_entries:13
u64 pos_increment:50;
u64 entries[]; // contiguous pos
};
And if a high 64 bit pos can't be represented with pos_increment then
you'd have flags = X and entries[0] == pos instead.
Jason
next prev parent reply other threads:[~2025-09-09 15:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-09 14:44 [RFC PATCH 0/4] " Pratyush Yadav
2025-09-09 14:44 ` [RFC PATCH 1/4] " Pratyush Yadav
2025-09-09 15:28 ` Jason Gunthorpe [this message]
2025-09-09 15:40 ` Pratyush Yadav
2025-09-09 15:50 ` Jason Gunthorpe
2025-09-09 14:44 ` [RFC PATCH 2/4] kho: use KHO array for preserved memory bitmap serialization Pratyush Yadav
2025-09-09 14:44 ` [RFC PATCH 3/4] kho: add support for preserving vmalloc allocations Pratyush Yadav
2025-09-09 14:44 ` [RFC PATCH 4/4] lib/test_kho: use kho_preserve_vmalloc instead of storing addresses in fdt Pratyush Yadav
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250909152814.GL789684@nvidia.com \
--to=jgg@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=bhe@redhat.com \
--cc=changyuanl@google.com \
--cc=chrisl@kernel.org \
--cc=dmatlack@google.com \
--cc=graf@amazon.com \
--cc=jasonmiu@google.com \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=pasha.tatashin@soleen.com \
--cc=pratyush@kernel.org \
--cc=rientjes@google.com \
--cc=rppt@kernel.org \
--cc=thomas.weissschuh@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox