From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:37614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QvOJP-00015W-KI for qemu-devel@nongnu.org; Mon, 22 Aug 2011 02:48:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QvOJO-0008VW-ID for qemu-devel@nongnu.org; Mon, 22 Aug 2011 02:48:43 -0400 Received: from mail-ww0-f53.google.com ([74.125.82.53]:50106) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QvOJO-0008VO-Dt for qemu-devel@nongnu.org; Mon, 22 Aug 2011 02:48:42 -0400 Received: by wwf25 with SMTP id 25so4441355wwf.10 for ; Sun, 21 Aug 2011 23:48:41 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4E51FBC6.1010404@redhat.com> Date: Mon, 22 Aug 2011 08:48:38 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <8f99d56f3a48b6255cf70425bc435d8f231f5352.1313552764.git.udeshpan@redhat.com> <4E4B5FA8.4020006@redhat.com> <4E4E00B1.9050009@redhat.com> In-Reply-To: <4E4E00B1.9050009@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH v4 2/5] ramlist mutex List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Umesh Deshpande Cc: mtosatti@redhat.com, qemu-devel@nongnu.org, kvm@vger.kernel.org, quintela@redhat.com On 08/19/2011 08:20 AM, Umesh Deshpande wrote: > Or, is it okay to convert all the ramblock list traversals in exec.c > (under iothread) to mru traversals, and probably it makes sense as the > original list was also maintained in the mru order, whereas the sequence > of blocks doesn't matter for the migration code. This way we don't have > to acquire the mutex for block list traversals. I'm not sure... as I said, the MRU list is on a fast path and restricting it to that fast path keeps us honest. Also, the non-MRU list is almost never accessed outside the migration thread, so the mutex shouldn't be heavily contended anyway. You can also think about (not too clever) ways to keep the mutex unlocked while not doing ram_save_live. BTW, actually the migration code tries to migrate the largest blocks first (because usually all the blocks after the first are small and easily migrated during the _complete pass), so the order does somewhat matter for migration. Paolo