Re: [PATCH v2 2/2] lib/raid6: use kvmalloc() in raid6_select_algo()

From: Mike Rapoport

Date: Wed May 27 2026 - 07:34:55 EST


On Wed, May 27, 2026 at 08:38:14AM +0200, Christoph Hellwig wrote:
> On Tue, May 26, 2026 at 10:34:24AM -0700, Andrew Morton wrote:
> > /* prepare the buffer and fill it circularly with gfmul table */
> > - disk_ptr = (char *)__get_free_pages(GFP_KERNEL, RAID6_TEST_DISKS_ORDER);
> > + disk_ptr = kvmalloc(PAGE_SIZE * RAID6_TEST_DISKS, GFP_KERNEL);
>
> This changes to vmalloc for no good reason. It also doesn't use

TBH, I didn't look around and just presumed that order-3 allocation is a
good candidate for vmalloc().
But given this runs early on boot, there's no real reason for vmalloc().

> the _array version for overflow-safe multiplying (not that it matters
> much here..)

Can do _array if you'd like, no strong feelings here.

--
Sincerely yours,
Mike.