From: Christoph Hellwig <hch@infradead.org>
To: Mike Rapoport <rppt@kernel.org>
Cc: Christoph Hellwig <hch@infradead.org>,
Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org
Subject: Re: [PATCH] block: partitions: replace __get_free_page() with kmalloc()
Date: Mon, 25 May 2026 00:16:23 -0700 [thread overview]
Message-ID: <ahP3R2nH8-bHMVf0@infradead.org> (raw)
In-Reply-To: <ahPxmSqT4Y4jcAbQ@kernel.org>
On Mon, May 25, 2026 at 09:52:09AM +0300, Mike Rapoport wrote:
> On Sun, May 24, 2026 at 11:08:31PM -0700, Christoph Hellwig wrote:
> > On Wed, May 20, 2026 at 11:15:52AM +0300, Mike Rapoport (Microsoft) wrote:
> > > check_partition() allocates a buffer to use as backing buffer for
> > > seq_buf.
> > >
> > > This buffer can be allocated with kmalloc() as there's nothing special
> > > about it to go directly to the page allocator.
> > >
> > > Replace use of __get_free_page() with kmalloc() and free_page() with
> > > kfree().
> >
> > So I heard various vague references that we should replace
> > __get_free_page with kmalloc, but nothing definitive. Can you please
> > point to a good resource for that?
>
> There was quite recent discussion when I posted patches that change
> __get_free_page to return void *:
>
> https://lore.kernel.org/all/20251018093002.3660549-1-rppt@kernel.org/
This doesn't tell much more.
> And an old thread when Al posted similar patches:
>
> https://lore.kernel.org/all/CA+55aFwp4iy4rtX2gE2WjBGFL=NxMVnoFeHqYa2j1dYOMMGqxg@mail.gmail.com/T/#u<S-Del>
This does, but it still fails to explain why kmalloc performs just as
well as __get_free_page(s) these days.
And such an explanation or link to it should go into every patch doing
this switch.
next prev parent reply other threads:[~2026-05-25 7:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-20 8:15 [PATCH] block: partitions: replace __get_free_page() with kmalloc() Mike Rapoport (Microsoft)
[not found] ` <ahPnX-CwVgK-9chp@infradead.org>
2026-05-25 6:52 ` Mike Rapoport
2026-05-25 7:16 ` Christoph Hellwig [this message]
2026-05-25 9:35 ` Mike Rapoport
2026-05-26 6:27 ` Christoph Hellwig
2026-05-26 12:07 ` Vlastimil Babka
2026-05-26 14:37 ` Matthew Wilcox
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=ahP3R2nH8-bHMVf0@infradead.org \
--to=hch@infradead.org \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--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