qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v5 1/9] Add cache handling functions


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH v5 1/9] Add cache handling functions
Date: Tue, 03 Jan 2012 13:54:45 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110922 Lightning/1.0b2 Thunderbird/3.1.15

On 01/03/2012 09:34 AM, Orit Wasserman wrote:
Add page caching mechanism.
The pages are stored in the cache ordered by their address.

Signed-off-by: Orit Wasserman<address@hidden>
---
  arch_init.c |  183 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  1 files changed, 183 insertions(+), 0 deletions(-)

diff --git a/arch_init.c b/arch_init.c
index d4c92b0..fdda277 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -28,6 +28,7 @@
  #include<sys/types.h>
  #include<sys/mman.h>
  #endif
+#include<assert.h>
  #include "config.h"
  #include "monitor.h"
  #include "sysemu.h"
@@ -42,6 +43,14 @@
  #include "gdbstub.h"
  #include "hw/smbios.h"

+#ifdef DEBUG_ARCH_INIT
+#define DPRINTF(fmt, ...) \
+    do { fprintf(stdout, "arch_init: " fmt, ## __VA_ARGS__); } while (0)
+#else
+#define DPRINTF(fmt, ...) \
+    do { } while (0)
+#endif
+
  #ifdef TARGET_SPARC
  int graphic_width = 1024;
  int graphic_height = 768;
@@ -94,6 +103,180 @@ const uint32_t arch_type = QEMU_ARCH;
  #define RAM_SAVE_FLAG_EOS      0x10
  #define RAM_SAVE_FLAG_CONTINUE 0x20

+/***********************************************************/
+/* Page cache for storing previous pages as basis for XBRLE compression */
+#define CACHE_N_WAY 2 /* 2-way assossiative cache */

Is there any reason we can't just use a GCache for this?

http://developer.gnome.org/glib/stable/glib-Caches.html

Regards,

Anthony Liguori



reply via email to

[Prev in Thread] Current Thread [Next in Thread]