io_uring/rsrc: keep one global dummy_ubuf
authorPavel Begunkov <asml.silence@gmail.com>
Fri, 11 Aug 2023 12:53:46 +0000 (13:53 +0100)
committerJens Axboe <axboe@kernel.dk>
Fri, 11 Aug 2023 16:42:57 +0000 (10:42 -0600)
commit19a63c4021702e389a559726b16fcbf07a8a05f9
tree6b7b8db21dfeba497e12914afec8d01cdbd28020
parentb6b2bb58a75407660f638a68e6e34a07036146d0
io_uring/rsrc: keep one global dummy_ubuf

We set empty registered buffers to dummy_ubuf as an optimisation.
Currently, we allocate the dummy entry for each ring, whenever we can
simply have one global instance.

We're casting out const on assignment, it's fine as we're not going to
change the content of the dummy, the constness gives us an extra layer
of protection if sth ever goes wrong.

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