io_uring/memmap: account memory before pinning
authorPavel Begunkov <asml.silence@gmail.com>
Fri, 29 Nov 2024 13:34:26 +0000 (13:34 +0000)
committerJens Axboe <axboe@kernel.dk>
Mon, 16 Dec 2024 13:58:14 +0000 (06:58 -0700)
commit728db59a9911eb34644a397ff6b0b94b55f775c0
tree857904323fb5989ae8476c30cdd303b8fc3b9d86
parent2d381329896e36b8bb25c521f3a636d1c9fedc2d
io_uring/memmap: account memory before pinning

Move memory accounting before page pinning. It shouldn't even try to pin
pages if it's not allowed, and accounting is also relatively
inexpensive. It also give a better code structure as we do generic
accounting and then can branch for different mapping types.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/1e242b8038411a222e8b269d35e021fa5015289f.1732886067.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/memmap.c