From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37539) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TEbb6-0007sn-8C for qemu-devel@nongnu.org; Thu, 20 Sep 2012 03:55:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TEbb1-00034M-D8 for qemu-devel@nongnu.org; Thu, 20 Sep 2012 03:54:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45732) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TEbb1-000348-58 for qemu-devel@nongnu.org; Thu, 20 Sep 2012 03:54:51 -0400 Message-ID: <505ACBC4.3030903@redhat.com> Date: Thu, 20 Sep 2012 09:54:44 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <50597D1F.3070607@redhat.com> <50598B58.4010704@redhat.com> <50598D0D.2090608@redhat.com> <50598F0C.2040301@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 20/09/2012 09:51, liu ping fan ha scritto: > Sorry, donot catching your meaning. Does not "coarse->fine" mean > LOCK(coarse)-->LOCK(fine); .. UNLOCK(fine)-->UNLOCK(coarse) ? Yes. >> > Valid: >> > lock(coarse) >> > lock(fine) >> > > But it is conflict with " localLock(fine) --> bigLock(coarse)" which > is taken when mmio dispatch. No, MMIO dispatch has to discard the fine-grained lock before acquiring the big lock. If you allow lock(fine) lock(coarse) then the (presumably higher-priority) thread that is requesting the fine-grained lock must wait for the lower-priority thread that holds the coarse-grained lock. Then you get priority inversion. Paolo