From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54623) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6ABP-0007W6-Ha for qemu-devel@nongnu.org; Mon, 27 Aug 2012 21:01:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T6ABO-0007mJ-9b for qemu-devel@nongnu.org; Mon, 27 Aug 2012 21:01:31 -0400 Received: from mout.web.de ([212.227.15.3]:63494) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6ABN-0007mD-Vt for qemu-devel@nongnu.org; Mon, 27 Aug 2012 21:01:30 -0400 Message-ID: <503C185B.4030401@web.de> Date: Tue, 28 Aug 2012 03:01:15 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <1345801763-24227-1-git-send-email-qemulist@gmail.com> <1345801763-24227-11-git-send-email-qemulist@gmail.com> <503792F1.4090109@redhat.com> <503B1B4B.6050108@redhat.com> <503B260E.70607@web.de> <503BA9BC.5010207@redhat.com> <503BAAF0.2020103@siemens.com> <503BB7E7.4050709@redhat.com> <503BB9C5.3030605@siemens.com> <503BBA77.4090006@redhat.com> <503BBED4.9050705@siemens.com> <503BC1EE.4060608@redhat.com> <503BCCA1.10403@siemens.com> <503BDE63.7090602@redhat.com> In-Reply-To: <503BDE63.7090602@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig3F15A991360F07DD835A583A" Subject: Re: [Qemu-devel] [PATCH 10/10] qdev: fix create in place obj's life cycle problem List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Paolo Bonzini , Liu Ping Fan , liu ping fan , Anthony Liguori , "qemu-devel@nongnu.org" This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig3F15A991360F07DD835A583A Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2012-08-27 22:53, Avi Kivity wrote: > On 08/27/2012 12:38 PM, Jan Kiszka wrote: >>>> Even worse, apply >>>> restrictions on how the dispatched objects, the regions, have to be >>>> treated because of this. >>> >>> Please elaborate. >> >> The fact that you can't manipulate a memory region object arbitrarily >> after removing it from the mapping because you track the references to= >> the object that the region points to, not the region itself. The regio= n >> remains in use by the dispatching layer and potentially the called >> device, even after deregistration. >=20 > That object will be a container_of() the region, usually literally but > sometimes only in spirit. Reference counting the regions means they > cannot be embedded into other objects any more. I cannot follow the logic of the last sentence. Reference counting just means that we track if there are users left, not necessarily that we perform asynchronous releases. We can simply wait for those users to complete. >=20 > We can probably figure out a way to flush out accesses. After switchin= g > to rcu, for example, all we need is synchronize_rcu() in a > non-deadlocking place. But my bet is that it will not be needed. If you properly flush out accesses, you don't need to track at device level anymore - and mess with abstraction layers. That's my whole point. Jan --------------enig3F15A991360F07DD835A583A Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iEYEARECAAYFAlA8GFsACgkQitSsb3rl5xTo3wCgssWPrDv61KgZ/UnLvEhn7v7S iowAoMNpAij/VRmCDlUeojmu0pdCRcne =laVQ -----END PGP SIGNATURE----- --------------enig3F15A991360F07DD835A583A--