From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Si1F9-0002EJ-L6 for qemu-devel@nongnu.org; Fri, 22 Jun 2012 06:37:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Si1F7-0004Jr-Bt for qemu-devel@nongnu.org; Fri, 22 Jun 2012 06:37:35 -0400 Received: from goliath.siemens.de ([192.35.17.28]:17536) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Si1F7-0004JC-1z for qemu-devel@nongnu.org; Fri, 22 Jun 2012 06:37:33 -0400 Message-ID: <4FE44AE7.6050509@siemens.com> Date: Fri, 22 Jun 2012 12:37:27 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <1340290158-11036-1-git-send-email-qemulist@gmail.com> <4FE33C61.9000509@siemens.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC] use little granularity lock to substitue qemu_mutex_lock_iothread List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: liu ping fan Cc: "qemu-devel@nongnu.org" , Anthony Liguori On 2012-06-22 12:24, liu ping fan wrote: > On Thu, Jun 21, 2012 at 11:23 PM, Jan Kiszka wrote: >> On 2012-06-21 16:49, Liu Ping Fan wrote: >>> Nowadays, we use qemu_mutex_lock_iothread()/qemu_mutex_unlock_iothread() to >>> protect the race to access the emulated dev launched by vcpu threads & iothread. >>> >>> But this lock is too big. We can break it down. >>> These patches separate the CPUArchState's protection from the other devices, so we >>> can have a per-cpu lock for each CPUArchState, not the big lock any longer. >> >> Anything that reduces lock dependencies is generally welcome. But can >> you specify in more details what you gain, and under which conditions? >> > In fact, there are several steps to break down the Qemu big lock. This > step just aims to shrink the code area protected by > qemu_mutex_lock_iothread()/qemu_mutex_unlock_iothread(). And I am > working on the following steps, which focus on breaking down the big > lock when calling handle_{io,mmio} Then let us discuss the strategy. This is important as it is unrealistic to break up the lock for all code paths. We really need to focus on goals that provide benefits for relevant use cases. Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux