From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjjQM-0001ZU-W1 for qemu-devel@nongnu.org; Mon, 12 May 2014 02:09:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WjjQD-0005BV-Tq for qemu-devel@nongnu.org; Mon, 12 May 2014 02:09:18 -0400 Received: from mail-wi0-x22d.google.com ([2a00:1450:400c:c05::22d]:49777) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjjQD-0005BO-NC for qemu-devel@nongnu.org; Mon, 12 May 2014 02:09:09 -0400 Received: by mail-wi0-f173.google.com with SMTP id bs8so3862630wib.12 for ; Sun, 11 May 2014 23:09:08 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <53706580.2050306@redhat.com> Date: Mon, 12 May 2014 08:09:04 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1399719075-11517-1-git-send-email-pl@kamp.de> <536E46C3.1050502@redhat.com> <536E5495.6080401@kamp.de> In-Reply-To: <536E5495.6080401@kamp.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] migration: cache memory region ram ptr List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven , qemu-devel@nongnu.org Cc: dgilbert@redhat.com, quintela@redhat.com Il 10/05/2014 18:32, Peter Lieven ha scritto: > What about XEN? > You're right, Xen wouldn't work. Your original patch would not break it just because Xen doesn't use migration (but the code would be broken). You would have to cache qemu_get_ram_block rather than qemu_get_ram_ptr, move RAMBlock to memory-internal.h, and split the RAMBlock + ram_addr_t => void * conversion out of qemu_get_ram_ptr and into a separate function (to be used by memory_region_get_ram_ptr). I'm not sure of the benefit of your patch though. qemu_get_ram_block already has a 1-item cache, are you seeing a low hit rate there? Or any other profiling that shows qemu_get_ram_ptr as hot? Paolo