Closed jmillan closed 11 months ago
Maybe this happens for this scenario (and services alike) where the cadence of packets being sent does not allow the io_sq_thread sleep and keeps it awaken all the time. Maybe the scenario does not fit SQPOLL design. I just wonder if it is me misusing the API.
This is how polling works, it remains active until the desired idle time. It's impossible to poll for new SQ events without actually busy looping!
It's impossible to poll for new SQ events without actually busy looping!
Yes, I understand it. I think SQ polling does definitely not suit my use case.
Thanks @axboe!
uname -r
: 6.1.0-13-amd64liburing
: 2.4I'm successfully using liburing to send out UDP and TCP packets using
io_uring_prep_sendto
andio_uring_prep_write
respectively.I want to test the SQPOLL, so I initialize the ring with the given flag:
Once after calling
io_uring_prep_sendto()
orio_uring_prep_write()
, ifIORING_SQ_NEED_WAKEUP
flag is set, I callio_uring_submit()
:This is working properly in the sense that packets are sent as expected, but an io_sq_thread is taking all the CPU.
When the thread is idle there is no CPU usage, but once it's awaken with
io_uring_submit
, it takes all the CPU again. Am I using it incorrectly?My use case is a media server relaying network packets from one endpoint to one or many other endpoints.