On Mon, Jun 03, 2019 at 06:08:18PM +0530, Aarushi Mehta wrote:
> +static void qemu_luring_process_completions(LuringState *s)
> +{
> + struct io_uring_cqe *cqes;
> + int ret;
> +
> + /*
> + * Request completion callbacks can run the nested event loop.
> + * Schedule ourselves so the nested event loop will "see" remaining
> + * completed requests and process them. Without this, completion
> + * callbacks that wait for other requests using a nested event loop
> + * would hang forever.
> + */
> + qemu_bh_schedule(s->completion_bh);
> +
> + while (io_uring_peek_cqe(&s->ring, &cqes) == 0) {
> + if (!cqes) {
> + break;
> + }
> + LuringAIOCB *luringcb = io_uring_cqe_get_data(cqes);
> + read_barrier();
What is the purpose of this barrier?
> +static void qemu_luring_process_completions_and_submit(LuringState *s)
> +{
> + aio_context_acquire(s->aio_context);
> + qemu_luring_process_completions(s);
> +
> + if (!s->io_q.plugged && !s->io_q.in_queue) {
Submit when there are queued requesting waiting for submission:
s/!s->io_q.in_queue/s->io_q.in_queue > 0/
signature.asc
Description: PGP signature
