From: Jason Gunthorpe <jgg@nvidia.com>
To: Pasha Tatashin <pasha.tatashin@soleen.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>,
Mike Rapoport <rppt@kernel.org>,
Pratyush Yadav <pratyush@kernel.org>,
kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org
Subject: Re: [PATCH v2 1/3] kho: Adopt KHO radix tree data structures
Date: Fri, 24 Oct 2025 08:43:11 -0300 [thread overview]
Message-ID: <20251024114311.GB847003@nvidia.com> (raw)
In-Reply-To: <CA+CK2bCR0r61cnVxff6XSPoVN+ZxxS8rLHy0Mp6922xypCP8jA@mail.gmail.com>
On Thu, Oct 23, 2025 at 09:23:30PM -0400, Pasha Tatashin wrote:
> On Thu, Oct 23, 2025 at 7:45 PM Jason Gunthorpe <jgg@nvidia.com> wrote:
> >
> > On Mon, Oct 20, 2025 at 03:03:04AM -0700, Jason Miu wrote:
> >
> > > +static struct kho_radix_tree *kho_alloc_radix_tree(void)
> > > {
> > > + return (struct kho_radix_tree *)get_zeroed_page(GFP_KERNEL);
> > > +}
> >
> > I was reading the thread over here:
> >
> > https://lore.kernel.org/all/20151222210435.GB20997@ZenIV.linux.org.uk/
> >
> > And I guess this stuff should just use
> > kzalloc(sizeof(struct kho_radix_tree), GFP_KERNEL);
>
> kzalloc() uses slab, which in turn may use kfence objects, and kfence
> can allocate memory from KHO scratch area, leading to memory
> corruptions. Let's not use slab allocator for KHO preserved and
> metadata memory, it is not a good choice.
That sounds like a nasty subtle problem to have :(
Really should provide a kho allocator API to document these needs!
Jason
next prev parent reply other threads:[~2025-10-24 11:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-20 10:03 [PATCH v2 0/3] Make KHO Stateless Jason Miu
2025-10-20 10:03 ` [PATCH v2 1/3] kho: Adopt KHO radix tree data structures Jason Miu
2025-10-22 15:51 ` David Matlack
2025-10-23 0:51 ` Jason Miu
2025-10-23 17:43 ` Jason Gunthorpe
2025-10-29 1:28 ` Jason Miu
2025-10-23 23:45 ` Jason Gunthorpe
2025-10-24 1:23 ` Pasha Tatashin
2025-10-24 11:43 ` Jason Gunthorpe [this message]
2025-10-27 11:53 ` Mike Rapoport
2025-10-29 2:08 ` Jason Miu
2025-10-20 10:03 ` [PATCH v2 2/3] memblock: kho: Remove KHO notifier usage Jason Miu
2025-10-20 10:03 ` [PATCH v2 3/3] kho: Remove notifier system infrastructure Jason Miu
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=20251024114311.GB847003@nvidia.com \
--to=jgg@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=bhe@redhat.com \
--cc=changyuanl@google.com \
--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 \
/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