From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50012) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQdPy-000679-6q for qemu-devel@nongnu.org; Tue, 23 Oct 2012 08:17:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TQdPs-00052U-6K for qemu-devel@nongnu.org; Tue, 23 Oct 2012 08:17:10 -0400 Received: from goliath.siemens.de ([192.35.17.28]:17122) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQdPr-00052L-W9 for qemu-devel@nongnu.org; Tue, 23 Oct 2012 08:17:04 -0400 Message-ID: <50868ABA.2090600@siemens.com> Date: Tue, 23 Oct 2012 14:16:58 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <1350897839-29593-1-git-send-email-pingfank@linux.vnet.ibm.com> <1350897839-29593-6-git-send-email-pingfank@linux.vnet.ibm.com> <5085140F.2070603@redhat.com> <508684BE.1080103@redhat.com> <508685C0.60700@redhat.com> <508687C4.4030109@siemens.com> <5086899A.5020702@redhat.com> In-Reply-To: <5086899A.5020702@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [patch v4 05/16] memory: introduce ref, unref interface for MemoryRegionOps List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Liu Ping Fan , Stefan Hajnoczi , Marcelo Tosatti , "qemu-devel@nongnu.org" , Avi Kivity , Anthony Liguori On 2012-10-23 14:12, Paolo Bonzini wrote: > Il 23/10/2012 14:04, Jan Kiszka ha scritto: >>>>>> >>>>>> So the stop_machine idea is thrown away? >>>> >>>> IIRC I convinced myself that it's just as bad. >> One tricky part with stop machine is that legacy code may trigger it >> while holding the BQL, does not expect to lose that lock even for a >> brief while, but synchronizing on other threads does require dropping >> the lock right now. Maybe an implementation detail, but at least a nasty >> one. > > But it would only be triggered by hot-unplug, no? Once all code that adds/removes memory regions from within access handlers is converted. Legacy is biting, not necessarily the pure model. > That is already an > asynchronous action, so it is not a problem to delay the actual > stop_machine+qdev_free (and just that part!) to a bottom half or another > place when it is safe to drop the BQL. Jan -- Siemens AG, Corporate Technology, CT RTC ITP SDP-DE Corporate Competence Center Embedded Linux