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>
Thu, 25 Mar 2021 16:24:27 +0000 (10:24 -0600)
commit76a821553e54ff22326e2a4c5303d14373bfc3a5
tree2db88f4e759f3a5ccca849a6bd206d9477692110
parent4f0f5d1f02aee7b3eaa0d4412af52a341f06f7aa
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