From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35133) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VFJva-0001Bl-Hj for qemu-devel@nongnu.org; Fri, 30 Aug 2013 04:19:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VFJvU-0006DC-JM for qemu-devel@nongnu.org; Fri, 30 Aug 2013 04:19:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:9695) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VFJvU-0006D1-Bo for qemu-devel@nongnu.org; Fri, 30 Aug 2013 04:19:28 -0400 Message-ID: <52205584.5080509@redhat.com> Date: Fri, 30 Aug 2013 10:19:16 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1377705768-21996-1-git-send-email-ncmike@ncultra.org> <521E26B8.7090801@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH] convert ram_list to RCU DQ List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mike Day Cc: Paul Mckenney , Mathew Desnoyers , qemu-devel@nongnu.org, Anthony Liguori 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