]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
md/raid5: use mempool to allocate stripe_request_ctx
authorYu Kuai <yukuai@fnnas.com>
Wed, 14 Jan 2026 17:12:33 +0000 (01:12 +0800)
committerYu Kuai <yukuai@fnnas.com>
Mon, 26 Jan 2026 05:11:29 +0000 (13:11 +0800)
commit9340a95d489ab5ff3c2d18c78283211b03a4265a
tree2277b7a3d0304a673737aecd974cc900cd737972
parent10787568cc1f3f80afc510b2728751989dfa0ae6
md/raid5: use mempool to allocate stripe_request_ctx

On the one hand, stripe_request_ctx is 72 bytes, and it's a bit huge for
a stack variable.

On the other hand, the bitmap sectors_to_do is a fixed size, result in
max_hw_sector_kb of raid5 array is at most 256 * 4k = 1Mb, and this will
make full stripe IO impossible for the array that chunk_size * data_disks
is bigger. Allocate ctx during runtime will make it possible to get rid
of this limit.

Link: https://lore.kernel.org/linux-raid/20260114171241.3043364-6-yukuai@fnnas.com
Signed-off-by: Yu Kuai <yukuai@fnnas.com>
Reviewed-by: Li Nan <linan122@huawei.com>
drivers/md/md.h
drivers/md/raid1-10.c
drivers/md/raid5.c
drivers/md/raid5.h