From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH 03/15] qom: introduce reclaimer to release obj Date: Thu, 09 Aug 2012 09:49:24 +0200 Message-ID: <50236B84.2020606@redhat.com> References: <1344407156-25562-1-git-send-email-qemulist@gmail.com> <1344407156-25562-4-git-send-email-qemulist@gmail.com> <50222BC7.4060809@redhat.com> <50222C3B.1010302@redhat.com> <50222E2D.7050300@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Avi Kivity , kvm@vger.kernel.org, Jan Kiszka , Marcelo Tosatti , qemu-devel@nongnu.org, Blue Swirl , Anthony Liguori , Stefan Hajnoczi , =?ISO-8859-1?Q?Andreas_F=E4rber?= To: liu ping fan Return-path: Received: from mail-pb0-f46.google.com ([209.85.160.46]:63959 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755696Ab2HIHtc (ORCPT ); Thu, 9 Aug 2012 03:49:32 -0400 Received: by pbbrr13 with SMTP id rr13so493806pbb.19 for ; Thu, 09 Aug 2012 00:49:32 -0700 (PDT) In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: Il 09/08/2012 09:33, liu ping fan ha scritto: > Yes, it is to defer destructors. > See 0009-memory-prepare-flatview-and-radix-tree-for-rcu-style.patch > When MemoryRegion is _del_subregion from mem in updater, it may be > still in use by reader -- radix or flatview, so defer its destructors > to the reclaimer --phys_map_release(PhysMap *map) How are you sure that the reader is already out of its critical section by the time the reclaimer runs? > If we have rcu, it could be elegant to do this. Yeah, I think inventing primitives is dangerous and difficult to review; and it may be difficult to replace it with proper call_rcu. You should probably make a proof-of-concept using liburcu. Then we can decide how to implement RCU in a way that is portable enough for QEMU's needs. Paolo From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53388) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzNUs-0005dv-GE for qemu-devel@nongnu.org; Thu, 09 Aug 2012 03:49:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SzNUr-00068g-03 for qemu-devel@nongnu.org; Thu, 09 Aug 2012 03:49:34 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:45302) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzNUq-00068I-QT for qemu-devel@nongnu.org; Thu, 09 Aug 2012 03:49:32 -0400 Received: by pbbrp12 with SMTP id rp12so462999pbb.4 for ; Thu, 09 Aug 2012 00:49:32 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <50236B84.2020606@redhat.com> Date: Thu, 09 Aug 2012 09:49:24 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1344407156-25562-1-git-send-email-qemulist@gmail.com> <1344407156-25562-4-git-send-email-qemulist@gmail.com> <50222BC7.4060809@redhat.com> <50222C3B.1010302@redhat.com> <50222E2D.7050300@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 03/15] qom: introduce reclaimer to release obj List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: liu ping fan Cc: kvm@vger.kernel.org, Jan Kiszka , Marcelo Tosatti , qemu-devel@nongnu.org, Blue Swirl , Avi Kivity , Anthony Liguori , Stefan Hajnoczi , =?ISO-8859-1?Q?Andreas_F=E4rber?= Il 09/08/2012 09:33, liu ping fan ha scritto: > Yes, it is to defer destructors. > See 0009-memory-prepare-flatview-and-radix-tree-for-rcu-style.patch > When MemoryRegion is _del_subregion from mem in updater, it may be > still in use by reader -- radix or flatview, so defer its destructors > to the reclaimer --phys_map_release(PhysMap *map) How are you sure that the reader is already out of its critical section by the time the reclaimer runs? > If we have rcu, it could be elegant to do this. Yeah, I think inventing primitives is dangerous and difficult to review; and it may be difficult to replace it with proper call_rcu. You should probably make a proof-of-concept using liburcu. Then we can decide how to implement RCU in a way that is portable enough for QEMU's needs. Paolo