block: use on-stack page vec for <= UIO_FASTIOV
authorJens Axboe <axboe@kernel.dk>
Fri, 5 Aug 2022 22:44:34 +0000 (16:44 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 22 Aug 2022 16:07:56 +0000 (10:07 -0600)
commite88811bc43b971e06fa82d4e421e21b3c999c1a7
tree63b3e0072fbd45bd78ec3b04c0973db6e61c6347
parent8af870aa5b84729d7a39f84226be6f84e4943d8f
block: use on-stack page vec for <= UIO_FASTIOV

Avoid a kmalloc+kfree for each page array, if we only have a few pages
that are mapped. An alloc+free for each IO is quite expensive, and
it's pretty pointless if we're only dealing with 1 or a few vecs.

Use UIO_FASTIOV like we do in other spots to set a sane limit for how
big of an IO we want to avoid allocations for.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-map.c