From: Pasha Tatashin <pasha.tatashin@soleen.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: Jason Miu <jasonmiu@google.com>, Alexander Graf <graf@amazon.com>,
Andrew Morton <akpm@linux-foundation.org>,
Baoquan He <bhe@redhat.com>,
Changyuan Lyu <changyuanl@google.com>,
David Matlack <dmatlack@google.com>,
David Rientjes <rientjes@google.com>,
Joel Granados <joel.granados@kernel.org>,
Marcos Paulo de Souza <mpdesouza@suse.com>,
Mario Limonciello <mario.limonciello@amd.com>,
Mike Rapoport <rppt@kernel.org>, Petr Mladek <pmladek@suse.com>,
"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
Steven Chen <chenste@linux.microsoft.com>,
Yan Zhao <yan.y.zhao@intel.com>,
kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org
Subject: Re: [RFC v1 1/4] kho: Introduce KHO page table data structures
Date: Wed, 17 Sep 2025 12:18:39 -0400 [thread overview]
Message-ID: <CA+CK2bBbSSyCDAAgThDSSwH0WdOeHz-eVgB-1bdiwsDtTSE5pg@mail.gmail.com> (raw)
In-Reply-To: <20250917122158.GC1086830@nvidia.com>
On Wed, Sep 17, 2025 at 8:22 AM Jason Gunthorpe <jgg@nvidia.com> wrote:
>
> On Tue, Sep 16, 2025 at 07:50:16PM -0700, Jason Miu wrote:
> > + * kho_order_table
> > + * +-------------------------------+--------------------+
> > + * | 0 order| 1 order| 2 order ... | HUGETLB_PAGE_ORDER |
> > + * ++------------------------------+--------------------+
> > + * |
> > + * |
> > + * v
> > + * ++------+
> > + * | Lv6 | kho_page_table
> > + * ++------+
>
> I seem to remember suggesting this could be simplified without the
> special case 7h level table table for order.
>
> Encode the phys address as:
>
> (order << 51) | (phys >> (PAGE_SHIFT + order))
Why 51 and not 52, this limits to 63bit address space, is it not?
>
> Then you don't need another table for order, the 64 bits encode
> everything consistently. Order can't be > 52 so it is
> only 6 bits, meaning the result fits into at most 57 bits.
>
Hi Jason,
Nice packing. That's a really clever bit-packing scheme to create a
unified address space.
I like the idea, but I'm trying to find the benefits compared to the
current per-order tree approach.
1. Packing adds a slight performance overhead for higher orders. With
the current approach, preserving higher order pages only requires a
3/4-level page table. With bit-packing proposal we will always have
extra loads during preserve/unpreserve operations.
2. It also adds insignificant memory overhead, as extra levels will
have a couple extra pages.
3. It slightly complicates the logic in the new kernel. Instead of
simply iterating a known tree for a specific order, the boot-time
walker would need to reconstruct the per-order subtrees, and walk
them.
Perhaps I'm missing a key benefit of the unified tree? The current
approach might not be as elegant as having everything packed into the
same page table but it seems to be OK to me, and easy to understand.
Pasha
next prev parent reply other threads:[~2025-09-17 16:19 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-17 2:50 [RFC v1 0/4] Make KHO Stateless Jason Miu
2025-09-17 2:50 ` [RFC v1 1/4] kho: Introduce KHO page table data structures Jason Miu
2025-09-17 12:21 ` Jason Gunthorpe
2025-09-17 16:18 ` Pasha Tatashin [this message]
2025-09-17 16:32 ` Jason Gunthorpe
2025-09-19 6:49 ` Jason Miu
2025-09-19 12:56 ` Jason Gunthorpe
2025-09-17 2:50 ` [RFC v1 2/4] kho: Adopt KHO page tables and remove serialization Jason Miu
2025-09-17 17:52 ` Mike Rapoport
2025-09-19 6:58 ` Jason Miu
2025-09-17 2:50 ` [RFC v1 3/4] memblock: Remove KHO notifier usage Jason Miu
2025-09-17 2:50 ` [RFC v1 4/4] kho: Remove notifier system infrastructure Jason Miu
2025-09-17 11:36 ` [RFC v1 0/4] Make KHO Stateless Jason Gunthorpe
2025-09-17 14:48 ` Pasha Tatashin
2025-09-21 22:26 ` Matthew Wilcox
2025-09-21 23:07 ` Pasha Tatashin
2025-09-25 9:19 ` Mike Rapoport
2025-09-25 12:27 ` Pratyush Yadav
2025-09-25 12:33 ` Jason Gunthorpe
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=CA+CK2bBbSSyCDAAgThDSSwH0WdOeHz-eVgB-1bdiwsDtTSE5pg@mail.gmail.com \
--to=pasha.tatashin@soleen.com \
--cc=akpm@linux-foundation.org \
--cc=bhe@redhat.com \
--cc=changyuanl@google.com \
--cc=chenste@linux.microsoft.com \
--cc=dmatlack@google.com \
--cc=graf@amazon.com \
--cc=jasonmiu@google.com \
--cc=jgg@nvidia.com \
--cc=joel.granados@kernel.org \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mario.limonciello@amd.com \
--cc=mpdesouza@suse.com \
--cc=pmladek@suse.com \
--cc=rafael.j.wysocki@intel.com \
--cc=rientjes@google.com \
--cc=rppt@kernel.org \
--cc=yan.y.zhao@intel.com \
/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;
as well as URLs for NNTP newsgroup(s).