summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMike Rapoport (Microsoft) <rppt@kernel.org>2026-05-28 12:53:00 +0300
committerAndrew Morton <akpm@linux-foundation.org>2026-06-05 00:49:27 +0300
commitd280a26a983f62bfeff3f134f9d5ba4035356b43 (patch)
treebb2c0dc6eaccf25f500ef574ee0ea23676f3e8fb /scripts
parent9bd541e09dffff27e5bec0f9f45b0228173a5375 (diff)
downloadlinux-d280a26a983f62bfeff3f134f9d5ba4035356b43.tar.xz
xor: use kmalloc() in calibrate_xor_blocks()
Patch series "lib/raid: replace __get_free_pages() call with kmalloc()", v4. 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(). This patch (of 2): 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/20260528-lib-v4-0-4e3ad1277279@kernel.org Link: https://lore.kernel.org/all/635405e4-9423-4a25-a6e7-e03c8ea0bcbe@redhat.com Link: https://lore.kernel.org/all/635405e4-9423-4a25-a6e7-e03c8ea0bcbe@redhat.com Link: https://lore.kernel.org/20260528-lib-v4-1-4e3ad1277279@kernel.org Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org> Reviewed-by: Hannes Reinecke <hare@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Cc: Christoph Hellwig <hch@infradead.org> Cc: Li Nan <linan122@huawei.com> Cc: Song Liu <song@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions