io_uring: allocate memory for overflowed CQEs
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 23 Feb 2021 12:40:22 +0000 (12:40 +0000)
committerJens Axboe <axboe@kernel.dk>
Sun, 4 Apr 2021 21:27:26 +0000 (15:27 -0600)
commit502f5faf89755be0732a1a6e6c3646d1ecef4d0a
tree4093f509570a15296e9dd27b2dbd449fae41403b
parentc6eb90d57b8e817bc77c17100fffd9ce8a16473f
io_uring: allocate memory for overflowed CQEs

Instead of using a request itself for overflowed CQE stashing, allocate a
separate entry. The disadvantage is that the allocation may fail and it
will be accounted as lost (see rings->cq_overflow), so we lose reliability
in case of memory pressure if the application is driving the CQ ring into
overflow. However, it opens a way for for multiple CQEs per an SQE and
even generating SQE-less CQEs.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
[axboe: use GFP_ATOMIC | __GFP_ACCOUNT]
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c