aboutsummaryrefslogtreecommitdiffstats
path: root/io_uring/net.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2022-07-12 21:52:44 +0100
committerJens Axboe <axboe@kernel.dk>2022-07-24 18:41:07 -0600
commite29e3bd4b968d50bfb3bbdcee6bfdc340f7792cf (patch)
tree51fe9adcee0ba02f46cb789a3b02d09d44ffafac /io_uring/net.c
parent06a5464be84e4ae48394d34441baf34bf9706827 (diff)
downloadlinux-e29e3bd4b968d50bfb3bbdcee6bfdc340f7792cf.tar.gz
io_uring: account locked pages for non-fixed zc
Fixed buffers are RLIMIT_MEMLOCK accounted, however it doesn't cover iovec based zerocopy sends. Do the accounting on the io_uring side. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/19b6e3975440f59f1f6199c7ee7acf977b4eecdc.1657643355.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/net.c')
-rw-r--r--io_uring/net.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/io_uring/net.c b/io_uring/net.c
index 89a8678ce69bd..2d04a70b06321 100644
--- a/io_uring/net.c
+++ b/io_uring/net.c
@@ -906,6 +906,7 @@ int io_sendzc(struct io_kiocb *req, unsigned int issue_flags)
ret = import_single_range(WRITE, zc->buf, zc->len, &iov, &msg.msg_iter);
if (unlikely(ret))
return ret;
+ mm_account_pinned_pages(&notif->uarg.mmp, zc->len);
msg_flags = zc->msg_flags | MSG_ZEROCOPY;
if (issue_flags & IO_URING_F_NONBLOCK)