]> git.baikalelectronics.ru Git - kernel.git/commit
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, 11 Apr 2021 23:41:59 +0000 (17:41 -0600)
commitd41d64afb44f9cdc6a3da5bd37af4bd149a956cd
tree8e05279baf327e9b85e8cfd47675bada6c32ce2a
parent0071e45c4d24633d975b0c336637b501e1438b76
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