Re: Sending CQE to a different ring

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/10/22 9:07 AM, Artyom Pavlov wrote:
>>> Yes, passing positive result value would make more sense than PID of
>>> submitter, which is rarely, if ever, needed. IIUC we would not be able
>>> to use linking with such approach, since sqe->len has to be set in
>>> user code based on a received CQE, but I guess it should be fine in
>>> practice.
>>
>> Right, and using sqe->len and passing it through makes a lot more sense
>> in general as you can pass whatever you want there. If you want to use
>> the pid, you can use it like that. Or for whatever else you'd want. That
>> gives you both 'len' and 'user_data' as information you can pass between
>> the rings.
>>
>> It could also be used as `len` holding a message type, and `user_data`
>> holding a pointer to a struct. For example.
> 
> I like IORING_OP_WAKEUP_RING with sqe->len being copied to
> cqe->result. The only question I have is how should "negative" (i.e.
> bigger or equal to 2^31) lengths be handled. They either should be
> copied similarly to positive values or we should get an error.

Any IO transferring syscall in Linux supports INT_MAX as the maximum in
one request, which is also why the res field is sized the way it is. So
you cannot transfer more than that anyway, hence it should not be an
issue (at least specific to io_uring).

> Also what do you think about registering ring fds? Could it be
> beneficial?

Definitely, it'll make the overhead a bit lower for issuing the
IORING_OP_MSG_RING (it's been renamed ;-) request.

-- 
Jens Axboe




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux