qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 01/17] aio: introduce aio_co_schedule and aio_co


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 01/17] aio: introduce aio_co_schedule and aio_co_wake
Date: Mon, 30 Jan 2017 15:15:51 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1


On 30/01/2017 10:18, Stefan Hajnoczi wrote:
> On Fri, Jan 20, 2017 at 05:43:06PM +0100, Paolo Bonzini wrote:
>> diff --git a/include/qemu/coroutine_int.h b/include/qemu/coroutine_int.h
>> index 14d4f1d..1efa356 100644
>> --- a/include/qemu/coroutine_int.h
>> +++ b/include/qemu/coroutine_int.h
>> @@ -40,12 +40,20 @@ struct Coroutine {
>>      CoroutineEntry *entry;
>>      void *entry_arg;
>>      Coroutine *caller;
>> +
>> +    /* Only used when the coroutine has terminated.  */
>>      QSLIST_ENTRY(Coroutine) pool_next;
>>      size_t locks_held;
> 
> locks_held is used when the coroutine is running.  Please add a newline
> to separate it from pool_next.
> 
>>  
>> -    /* Coroutines that should be woken up when we yield or terminate */
>> +    /* Coroutines that should be woken up when we yield or terminate.
>> +     * Only used when the coroutine is running.
>> +     */
>>      QSIMPLEQ_HEAD(, Coroutine) co_queue_wakeup;
>> +
>> +    /* Only used when the coroutine is sleeping.  */
> 
> "running", "yielded", and "terminated" are terms with specific meanings.
> Is "sleeping" a subset of "yielded" where the coroutine is waiting for a
> mutex or its AioContext to schedule it?

No, I'll just change it to "has yielded".

>> +static void test_multi_co_schedule_entry(void *opaque)
> 
> Missing coroutine_fn.
> 
>> diff --git a/tests/test-vmstate.c b/tests/test-vmstate.c
>> index d2f529b..cb87997 100644
>> --- a/tests/test-vmstate.c
>> +++ b/tests/test-vmstate.c
>> @@ -33,17 +33,6 @@
>>  static char temp_file[] = "/tmp/vmst.test.XXXXXX";
>>  static int temp_fd;
>>  
>> -/* Fake yield_until_fd_readable() implementation so we don't have to pull 
>> the
>> - * coroutine code as dependency.
>> - */
>> -void yield_until_fd_readable(int fd)
>> -{
>> -    fd_set fds;
>> -    FD_ZERO(&fds);
>> -    FD_SET(fd, &fds);
>> -    select(fd + 1, &fds, NULL, NULL, NULL);
>> -}
>> -
>>  
>>  /* Duplicate temp_fd and seek to the beginning of the file */
>>  static QEMUFile *open_test_file(bool write)
> 
> This should be a separate patch.

Yes, it probably doesn't have to be in this series either.

Paolo



reply via email to

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