Sorry, hit send too quiclky.
If this is correct (it's not unreasonable, but should be
documented), then there should also be a simple way to force a
kernel entry. But how to do this using liburing? IIUC if I the
following apply:
1. I have no pending sqes
2. There are pending completions
3. There is a completed event for which a completion has not been
appended to the completion queue ring
Then io_uring_wait_cqe() will elide io_uring_enter() and the
completed-but-not-reported event will be delayed.
One way is to process all CQEs and then it'll try to enter the
kernel and do the job.
But I don't want it to wait. I want it to generate pending completions,
and return immediately even if no completions were generated. I have
some background computations I'm happy to perform if no events are
pending, but I would like those events to be generated promptly.
Another way is to also set IORING_SETUP_TASKRUN_FLAG, then when
there is work that requires to enter the kernel io_uring will
set IORING_SQ_TASKRUN in sq_flags.
Actually, I'm not mistaken io_uring has some automagic handling
of it internally
https://github.com/axboe/liburing/blob/master/src/queue.c#L36
Is there documentation about this flag?