From mboxrd@z Thu Jan 1 00:00:00 1970 From: liu ping fan Subject: Re: [PATCH 03/15] qom: introduce reclaimer to release obj Date: Thu, 9 Aug 2012 15:33:18 +0800 Message-ID: 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 Cc: kvm@vger.kernel.org, Jan Kiszka , Marcelo Tosatti , qemu-devel@nongnu.org, Blue Swirl , Anthony Liguori , Stefan Hajnoczi , Paolo Bonzini , =?ISO-8859-1?Q?Andreas_F=E4rber?= To: Avi Kivity Return-path: In-Reply-To: <50222E2D.7050300@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org List-Id: kvm.vger.kernel.org On Wed, Aug 8, 2012 at 5:15 PM, Avi Kivity wrote: > On 08/08/2012 12:07 PM, Paolo Bonzini wrote: >> Il 08/08/2012 11:05, Avi Kivity ha scritto: >>>> > From: Liu Ping Fan >>>> > >>>> > Collect unused object and release them at caller demand. >>>> > >>> Please explain the motivation for this patch. >> >> It's poor man RCU, I think? > > I thought that it was to defer destructors (finalizers) to a more > suitable context. But why is the unref context unsuitable? > 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) If we have rcu, it could be elegant to do this. I think, I should write the commit comment here too, not until the followed patch. Regards, pingfan > I don't see how it relates to RCU, where is the C and the U? > > Anyway the list eagerly awaits the explanation. > > -- > error compiling committee.c: too many arguments to function From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44651) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzNFV-0007h1-3J for qemu-devel@nongnu.org; Thu, 09 Aug 2012 03:33:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SzNFT-0001iu-Dy for qemu-devel@nongnu.org; Thu, 09 Aug 2012 03:33:41 -0400 Received: from mail-we0-f173.google.com ([74.125.82.173]:34634) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzNFT-0001ij-6E for qemu-devel@nongnu.org; Thu, 09 Aug 2012 03:33:39 -0400 Received: by weyz53 with SMTP id z53so95895wey.4 for ; Thu, 09 Aug 2012 00:33:38 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <50222E2D.7050300@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> From: liu ping fan Date: Thu, 9 Aug 2012 15:33:18 +0800 Message-ID: Content-Type: text/plain; charset=ISO-8859-1 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: Avi Kivity Cc: kvm@vger.kernel.org, Jan Kiszka , Marcelo Tosatti , qemu-devel@nongnu.org, Blue Swirl , Anthony Liguori , Stefan Hajnoczi , Paolo Bonzini , =?ISO-8859-1?Q?Andreas_F=E4rber?= On Wed, Aug 8, 2012 at 5:15 PM, Avi Kivity wrote: > On 08/08/2012 12:07 PM, Paolo Bonzini wrote: >> Il 08/08/2012 11:05, Avi Kivity ha scritto: >>>> > From: Liu Ping Fan >>>> > >>>> > Collect unused object and release them at caller demand. >>>> > >>> Please explain the motivation for this patch. >> >> It's poor man RCU, I think? > > I thought that it was to defer destructors (finalizers) to a more > suitable context. But why is the unref context unsuitable? > 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) If we have rcu, it could be elegant to do this. I think, I should write the commit comment here too, not until the followed patch. Regards, pingfan > I don't see how it relates to RCU, where is the C and the U? > > Anyway the list eagerly awaits the explanation. > > -- > error compiling committee.c: too many arguments to function