qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 30/51] ram: Move src_page_req* to RAMState


From: Juan Quintela
Subject: Re: [Qemu-devel] [PATCH 30/51] ram: Move src_page_req* to RAMState
Date: Thu, 30 Mar 2017 18:09:54 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Peter Xu <address@hidden> wrote:
> On Thu, Mar 23, 2017 at 09:45:23PM +0100, Juan Quintela wrote:
>> This are the last postcopy fields still at MigrationState.  Once there
>
> s/This/These/
>
>> Move MigrationSrcPageRequest to ram.c and remove MigrationState
>> parameters where appropiate.
>> 
>> Signed-off-by: Juan Quintela <address@hidden>
>
> Reviewed-by: Peter Xu <address@hidden>
>
> One question below though...
>
> [...]
>
>> @@ -1191,19 +1204,18 @@ static bool get_queued_page(RAMState *rs, 
>> MigrationState *ms,
>>   *
>>   * It should be empty at the end anyway, but in error cases there may
>>   * xbe some left.
>> - *
>> - * @ms: current migration state
>>   */
>> -void flush_page_queue(MigrationState *ms)
>> +void flush_page_queue(void)
>>  {
>> -    struct MigrationSrcPageRequest *mspr, *next_mspr;
>> +    struct RAMSrcPageRequest *mspr, *next_mspr;
>> +    RAMState *rs = &ram_state;
>>      /* This queue generally should be empty - but in the case of a failed
>>       * migration might have some droppings in.
>>       */
>>      rcu_read_lock();
>
> Could I ask why we are taking the RCU read lock rather than the mutex
> here?

I will let this one for dave.


>
>> -    QSIMPLEQ_FOREACH_SAFE(mspr, &ms->src_page_requests, next_req, 
>> next_mspr) {
>> +    QSIMPLEQ_FOREACH_SAFE(mspr, &rs->src_page_requests, next_req, 
>> next_mspr) {
>>          memory_region_unref(mspr->rb->mr);
>> -        QSIMPLEQ_REMOVE_HEAD(&ms->src_page_requests, next_req);
>> +        QSIMPLEQ_REMOVE_HEAD(&rs->src_page_requests, next_req);
>>          g_free(mspr);
>>      }
>>      rcu_read_unlock();
>
> Thanks,
>
> -- peterx



reply via email to

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