qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH] convert ram_list to RCU DQ


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [RFC PATCH] convert ram_list to RCU DQ
Date: Fri, 30 Aug 2013 10:19:16 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8

Il 29/08/2013 21:18, Mike Day ha scritto:
> 
>> Similarly, here the critical section includes the caller, and block is
>> living across calls to host.  Again, for now just put all of ram_load
>> under a huge RCU critical section.  Later we can use ram_list.version to
>> refresh the list and make the critical sections smaller.
> 
> And: rcu_read_lock() and rcu_read_unlock() can be called recursively, so
> I can still leave the lock/unlock pair in host_from_stream_offset. 

I'm not sure about that; returning an RCU-protected variable after
rcu_read_unlock() seems wrong to me because the pointer may not be valid
at that point.  I suggest using a comment that asks to call
host_from_stream_offset within rcu_read_lock()/rcu_read_unlock().
However, if existing practice in the kernel is different, I'll bow to that.

Paolo



reply via email to

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