Re: [PATCH] io_uring: add io_uring_enter(2) fixed file support

Jens Axboe
2022-03-04T02:43:33Z

On 3/3/22 7:28 PM, Pavel Begunkov wrote:
> On 3/4/22 02:18, Jens Axboe wrote:
>> On 3/3/22 6:49 PM, Pavel Begunkov wrote:
>>> On 3/3/22 16:31, Jens Axboe wrote:
>>>> On 3/3/22 7:40 AM, Jens Axboe wrote:
>>>>> On 3/3/22 7:36 AM, Jens Axboe wrote:
>>>>>> The only potential oddity here is that the fd passed back is not a
>>>>>> legitimate fd. io_uring does support poll(2) on its file descriptor, so
>>>>>> that could cause some confusion even if I don't think anyone actually
>>>>>> does poll(2) on io_uring.
>>>>>
> [...]
>>>> which is about a 15% improvement, pretty massive...
>>>
>>> Is the bench single threaded (including io-wq)? Because if it
>>> is, get/put shouldn't do any atomics and I don't see where the
>>> result comes from.
>>
>> Yes, it has a main thread and IO threads. Which is not uncommon, most
>> things are multithreaded these days...
>
> They definitely are, just was confused by the bench as I can't
> recall t/io_uring having >1 threads for nops and/or direct bdev I/O

It has a main task that spawns a thread for each job. Even for nops
that's true. The main task just checks progress of each IO job (thread)
and prints it, sleeping most of the time.

--
Jens Axboe