Re: [PATCH v3 1/2] xor: use kmalloc() in calibrate_xor_blocks()

From: Mike Rapoport

Date: Thu May 28 2026 - 06:07:29 EST


On Thu, May 28, 2026 at 01:54:44AM -0700, Christoph Hellwig wrote:
> On Thu, May 28, 2026 at 10:27:55AM +0300, Mike Rapoport (Microsoft) wrote:
> > - b1 = (void *) __get_free_pages(GFP_KERNEL, 2);
> > + b1 = kmalloc(PAGE_SIZE * 4, GFP_KERNEL);
> > if (!b1) {
> > pr_warn("xor: Yikes! No memory available.\n");
> > return -ENOMEM;
> > @@ -132,7 +133,7 @@ static int __init calibrate_xor_blocks(void)
> > pr_info("xor: using function: %s (%d MB/sec)\n",
> > fastest->name, fastest->speed);
> >
> > - free_pages((unsigned long)b1, 2);
> > + kvfree(b1);
>
> This should be kfree now.

kvfree still works, but I'll send v4 for pedantry sake ;-P

--
Sincerely yours,
Mike.