From: Hannes Reinecke <hare@suse.de>
To: "Mike Rapoport (Microsoft)" <rppt@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Christoph Hellwig <hch@infradead.org>,
David Laight <david.laight.linux@gmail.com>,
Li Nan <linan122@huawei.com>, Song Liu <song@kernel.org>,
Xiao Ni <xiao@kernel.org>, Yu Kuai <yukuai@fnnas.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
linux-raid@vger.kernel.org
Subject: Re: [PATCH v4 1/2] xor: use kmalloc() in calibrate_xor_blocks()
Date: Thu, 28 May 2026 11:55:23 +0200 [thread overview]
Message-ID: <9e491e1f-b544-4cbc-9319-8f75cf0b2130@suse.de> (raw)
In-Reply-To: <20260528-lib-v4-1-4e3ad1277279@kernel.org>
On 5/28/26 11:53, Mike Rapoport (Microsoft) wrote:
> The xor benchmark allocates 4 pages for a scratch buffer that is used
> purely as a CPU-only XOR working area.
>
> This buffer can be allocated with kmalloc() as there's nothing special
> about it to go directly to the page allocator.
>
> kmalloc() provides a better API than ancient __get_free_pages().
> kmalloc() does not require ugly casts and kfree() does not need to know the
> size of the freed object.
>
> There is no performance difference because kmalloc() redirects allocations
> of such size to the page allocator.
>
> Replace __get_free_pages() call with kmalloc().
>
> Link: https://lore.kernel.org/all/635405e4-9423-4a25-a6e7-e03c8ea0bcbe@redhat.com
> Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
> ---
> lib/raid/xor/xor-core.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
Reviewed-by: Hannes Reinecke <hare@kernel.org>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
next prev parent reply other threads:[~2026-05-28 9:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-28 9:52 [PATCH v4 0/2] lib/raid: replace __get_free_pages() call with kvmalloc() Mike Rapoport (Microsoft)
2026-05-28 9:53 ` [PATCH v4 1/2] xor: use kmalloc() in calibrate_xor_blocks() Mike Rapoport (Microsoft)
2026-05-28 9:55 ` Hannes Reinecke [this message]
2026-05-28 12:47 ` Christoph Hellwig
2026-05-28 9:53 ` [PATCH v4 2/2] raid6: use kmalloc() in raid6_select_algo() Mike Rapoport (Microsoft)
2026-05-28 22:03 ` [PATCH v4 0/2] lib/raid: replace __get_free_pages() call with kvmalloc() Andrew Morton
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=9e491e1f-b544-4cbc-9319-8f75cf0b2130@suse.de \
--to=hare@suse.de \
--cc=akpm@linux-foundation.org \
--cc=david.laight.linux@gmail.com \
--cc=hch@infradead.org \
--cc=linan122@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-raid@vger.kernel.org \
--cc=rppt@kernel.org \
--cc=song@kernel.org \
--cc=xiao@kernel.org \
--cc=yukuai@fnnas.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
all inboxes | Powered by JetHome®