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: Mike Day
Subject: Re: [Qemu-devel] [RFC PATCH] convert ram_list to RCU DQ
Date: Fri, 30 Aug 2013 10:08:50 -0400


On Fri, Aug 30, 2013 at 4:19 AM, Paolo Bonzini <address@hidden> wrote:
>
>
> 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.

In this case the only caller is ram_load so I'm removing the critical section from within host_from_stream_offset, and adding comments to note that the ram_list needs to be protected by the caller. The current docs/rcu.txt information indicates that rcu critical sections can be "nested or overlapping." But your suggestion results in cleaner code - we will have to go back to this later as you noted earlier.

Mike 

reply via email to

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