qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 2/3] linux-aio: handling -EAGAIN for !s->io_q


From: Ming Lei
Subject: Re: [Qemu-devel] [PATCH v3 2/3] linux-aio: handling -EAGAIN for !s->io_q.plugged case
Date: Mon, 24 Nov 2014 18:11:31 +0800

On Mon, Nov 24, 2014 at 5:52 PM, Paolo Bonzini <address@hidden> wrote:
>
>
> On 18/11/2014 15:06, Paolo Bonzini wrote:
>>> > +    /* don't submit until next completion for -EAGAIN of non plug case */
>>> > +    if (unlikely(!s->io_q.plugged)) {
>>> > +        return 0;
>>> > +    }
>>> > +
>> Is this an optimization or a fix for something?
>
> Ah, if !io_q.plugged we must be in the -EAGAIN case, so no need to
> "submit immediately if queue depth is above 2/3".  Can you rewrite the

The above comment is only for io_q.plugged case, and for
!io_q.plugged with -EAGAIN, the requests is submitted in
retry path.

> comment like this:
>
>     /* This is reached in two cases: queue not plugged but io_submit
>      * returned -EAGAIN, or queue plugged.  In the latter case, start
>      * submitting some I/O if the queue is getting too full.  In the
>      * former case, instead, wait until an I/O operation is completed.
>      */
>     if (likely(idx <= s->io_q.size * 2 / 3) || unlikely(!s->io_q.plugged) {
>         return 0;
>     }

Yes, the above change need the corresponding comment, but this
patch needn't since the 1st case won't reach here, :-)

Thanks,
Ming Lei



reply via email to

[Prev in Thread] Current Thread [Next in Thread]