From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33580) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TEGN9-0008QC-7t for qemu-devel@nongnu.org; Wed, 19 Sep 2012 05:15:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TEGN3-00041R-DV for qemu-devel@nongnu.org; Wed, 19 Sep 2012 05:15:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11078) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TEGN3-0003zz-5t for qemu-devel@nongnu.org; Wed, 19 Sep 2012 05:15:01 -0400 Message-ID: <50598D0D.2090608@redhat.com> Date: Wed, 19 Sep 2012 11:14:53 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <50597D1F.3070607@redhat.com> <50598B58.4010704@redhat.com> In-Reply-To: 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: liu ping fan Cc: Jan Kiszka , Marcelo Tosatti , Avi Kivity , Anthony Liguori , qemu-devel@nongnu.org Il 19/09/2012 11:11, liu ping fan ha scritto: >> > Why not? devA will drop its local lock, devX will retake the big lock >> > recursively, devB will take its local lock. In the end, we have biglock >> > -> devB. >> > > But when adopting local lock, we assume take local lock, then biglock. No, because the local lock will be dropped before taking the biglock. The order must always be coarse->fine. 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. Paolo > Otherwise another thread will take biglock then local lock, which > cause the possibility of deadlock. >