block: use on-stack page vec for <= UIO_FASTIOV block-test
authorJens Axboe <axboe@kernel.dk>
Fri, 5 Aug 2022 22:44:34 +0000 (16:44 -0600)
committerJens Axboe <axboe@kernel.dk>
Sun, 7 Aug 2022 15:00:56 +0000 (09:00 -0600)
commit5dcc5d3ca2212920d79a28e15b34329b7298cd97
treebf0ece13a2750e8d8010a2d483091c288ef4ea1a
parentd09d4be9e0ff0cca335e461a6d28fd61131bb455
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