From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44563) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TEGTp-00079t-NG for qemu-devel@nongnu.org; Wed, 19 Sep 2012 05:22:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TEGTo-0006zp-QD for qemu-devel@nongnu.org; Wed, 19 Sep 2012 05:22:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46292) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TEGTo-0006zl-IC for qemu-devel@nongnu.org; Wed, 19 Sep 2012 05:22:00 -0400 Message-ID: <50598EB2.5040101@redhat.com> Date: Wed, 19 Sep 2012 12:21:54 +0300 From: Avi Kivity MIME-Version: 1.0 References: <50597D1F.3070607@redhat.com> <50598B58.4010704@redhat.com> <50598D0D.2090608@redhat.com> In-Reply-To: <50598D0D.2090608@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [big lock] Discussion about the convention of device's DMA each other after breaking down biglock List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Jan Kiszka , Marcelo Tosatti , liu ping fan , Anthony Liguori , qemu-devel@nongnu.org On 09/19/2012 12:14 PM, Paolo Bonzini wrote: > I don't know if the front-end (device) lock should come before or after > the back-end (e.g. netdev) lock in the hierarchy, but that's another story. I would say device -> backend. It's natural if the backend is the timer subsystem, so extend it from there to the block and network layers. Of course callbacks want it to be the other way round. We could solve the callback problem in the same way we're using for mmio callbacks. When providing the callback, give the subsystem ->ref() and ->unref() methods. As long as a callback is pending, the subsystem holds a reference. Once the callback has been invoked or cancelled, the reference can be released. -- error compiling committee.c: too many arguments to function