From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URd4G-0003vP-Ts for qemu-devel@nongnu.org; Mon, 15 Apr 2013 02:39:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1URd4F-0001uO-Ry for qemu-devel@nongnu.org; Mon, 15 Apr 2013 02:39:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28100) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URd4F-0001to-L4 for qemu-devel@nongnu.org; Mon, 15 Apr 2013 02:39:07 -0400 Message-ID: <516BA07F.2010108@redhat.com> Date: Mon, 15 Apr 2013 08:38:55 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1364804434-7980-1-git-send-email-qemulist@gmail.com> <1364804434-7980-3-git-send-email-qemulist@gmail.com> <20130411101118.GC9165@stefanha-thinkpad.redhat.com> <20130412083855.GC31055@stefanha-thinkpad.redhat.com> <5167DBFC.2060405@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/5] hostmem: make hostmem global and RAM hotunplg safe List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: liu ping fan Cc: Peter Maydell , Anthony Liguori , Stefan Hajnoczi , Marcelo Tosatti , qemu-devel@nongnu.org, Vasilis Liaskovitis , Jan Kiszka Il 15/04/2013 03:42, liu ping fan ha scritto: > > It will work because readers will grab either the hostmem_lock or the > > BQL, while writers will grab both. A kind of local/global lock, but I'm > > No only hostmem_lock is used to protect readers from writers. While > the writers are protected agaist each other by biglock. So leaving > the "cur_hostmem = next_hostmem" outside to reflect the lock's rules. Doesn't help much if you do not document them... Paolo