qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [Questions] NBD issue or CoMutex->holder issue?


From: Changlong Xie
Subject: Re: [Qemu-block] [Questions] NBD issue or CoMutex->holder issue?
Date: Wed, 12 Oct 2016 08:42:50 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

On 10/11/2016 06:47 PM, Paolo Bonzini wrote:
the free_sema->queue head, so set free_sema->holder as
>revelant coroutine.
NBD is using the CoMutex in a way that wasn't anticipated.  The simplest
fix is to change it to CoQueue, which is like a condition variable.
Instead of locking if in_flight >= MAX_NBD_REQUESTS - 1, wait on the
queue while in_flight == MAX_NBD_REQUESTS.  Instead of unlocking, use
qemu_co_queue_next to wake up one request.


Thanks for your explanation! will send out a patch later.


Thanks
        -Xie

Thanks for the report!

Paolo

>For example if there are N(N=26 and MAX_NBD_REQUESTS=16) nbd write
>requests, so we'll invoke nbd_client_co_pwritev 26 times.
>time     request No   Actions
>1         1           in_flight=1, Coroutine=C1
>2         2           in_flight=2, Coroutine=C2





reply via email to

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