Re: [PATCH v4 1/2] xor: use kmalloc() in calibrate_xor_blocks()
Hannes Reinecke <[email protected]>
| Newsgroups | gmane.linux.kernel,gmane.linux.kernel.mm,gmane.linux.raid |
|---|---|
| Message-ID | <[email protected]> |
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/[email protected] > Signed-off-by: Mike Rapoport (Microsoft) <[email protected]> > --- > lib/raid/xor/xor-core.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > Reviewed-by: Hannes Reinecke <[email protected]> Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect [email protected] +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