From: SeongJae Park <sj@kernel.org>
To: "Mike Rapoport (Microsoft)" <rppt@kernel.org>
Cc: SeongJae Park <sj@kernel.org>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org
Subject: Re: [PATCH] init: do_mounts: use kmalloc() for allocations of temporary buffers
Date: Wed, 20 May 2026 17:49:21 -0700 [thread overview]
Message-ID: <20260521004921.84647-1-sj@kernel.org> (raw)
In-Reply-To: <20260520-init-v1-1-aaf2ebac5ad9@kernel.org>
On Wed, 20 May 2026 11:16:51 +0300 "Mike Rapoport (Microsoft)" <rppt@kernel.org> wrote:
> Several places in init/do_mounts.c allocate temporary buffers for
> filesystem names or options using __get_free_page() or alloc_page().
>
> Usage of alloc_page() APIs is not required there and only creates
> unnecessary noise with castings or conversion from struct page to void *.
>
> kmalloc() is a better API for these uses and it also provides better
> scalability and more debugging possibilities.
>
> Replace use of __get_free_page() and alloc_page() with kmalloc().
Makes sense. I once wondered if kmalloc_objs() fits here, but kmalloc() also
looks good to me.
>
> While on it, add a check for -ENOMEM condition in mount_root_generic().
>
> Link: https://lore.kernel.org/all/635405e4-9423-4a25-a6e7-e03c8ea0bcbe@redhat.com
> Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Reviewed-by: SeongJae Park <sj@kernel.org>
Thanks,
SJ
[...]
next prev parent reply other threads:[~2026-05-21 0:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-20 8:16 [PATCH] init: do_mounts: use kmalloc() for allocations of temporary buffers Mike Rapoport (Microsoft)
2026-05-20 10:57 ` David Disseldorp
2026-05-20 12:41 ` kernel test robot
2026-05-21 0:49 ` SeongJae Park [this message]
2026-05-22 10:13 ` Christian Brauner
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=20260521004921.84647-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rppt@kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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