qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 9/9] Convert ram_list to RCU


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 9/9] Convert ram_list to RCU
Date: Wed, 11 Feb 2015 12:19:36 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0


On 11/02/2015 09:47, Fam Zheng wrote:
>> > +    rcu_read_lock();
>> > +    block = atomic_rcu_read(&ram_list.mru_block);
>> >      if (block && block->host && host - block->host < block->max_length) {
>> >          goto found;
>> >      }
>> >  
>> > -    QLIST_FOREACH(block, &ram_list.blocks, next) {
>> > +    QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
>> >          /* This case append when the block is not mapped. */
>> >          if (block->host == NULL) {
>> >              continue;
>            }
>            if (host - block->host < block->max_length) {
>                goto found;
>            }
>        }
> ////
>        return NULL;
> 
> Should we call rcu_read_unlock at "////"?

Yes.

Paolo



reply via email to

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