[Top][All Lists]

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

Re: [Qemu-devel] [PATCH v4 2/5] blockjob: add pause points

From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v4 2/5] blockjob: add pause points
Date: Thu, 16 Jun 2016 15:24:43 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0

On 16/06/2016 15:17, Stefan Hajnoczi wrote:
>> Right, we should document job->busy as a quiescent state where no one
>> will re-enter the coroutine.
> That statement doesn't correspond with how it's used:
> block_job_sleep_ns() leaves a timer pending and the job will re-enter
> when the timer expires.  So "no one will re-enter the coroutine" is
> too strict.

And of course you're right. :)  What I (sloppily) meant was "where the
block job code will not re-enter the coroutine", which is what makes it
safe to call block_job_enter().

> The important thing is it's safe to call block_job_enter().  In the
> block_job_sleep_ns() case the timer is cancelled to prevent doubly
> re-entry.
> The doc comment I have in v4 allows the block_job_sleep_ns() case:
>   /*
>    * Set to false by the job while the coroutine has yielded and may be
>    * re-entered by block_job_enter().  There may still be I/O or event loop
>    * activity pending.
>    */
>   bool busy;

Sounds good!


reply via email to

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