aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xenpaging/xenpaging.h
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-12-17 06:27:55 +0000
committerKeir Fraser <keir.fraser@citrix.com>2009-12-17 06:27:55 +0000
commit287d07f6a7b84d9caf6e734f987a02ef5de7561c (patch)
tree9621123f10a616f72073e5706d1e4fffa17d1889 /tools/xenpaging/xenpaging.h
parentc0c8c01d6776b3cb2c42a6a3c82e484992dc9265 (diff)
downloadxen-287d07f6a7b84d9caf6e734f987a02ef5de7561c.tar.gz
xen-287d07f6a7b84d9caf6e734f987a02ef5de7561c.tar.bz2
xen-287d07f6a7b84d9caf6e734f987a02ef5de7561c.zip
User-land tool for memory paging.
This tool will page out the specified number of pages from the specified domain. When a paged out page is accessed, Xen will issue a request and notify the tool over an event channel. The tool will process ther request, page the page in, and notify Xen. The current (default) policy tracks the 1024 most recently paged in pages and will not choose to evict any of those. This is done with the assumption that if a page is accessed, it is likely to be accessed again soon. Signed-off-by: Patrick Colp <Patrick.Colp@citrix.com>
Diffstat (limited to 'tools/xenpaging/xenpaging.h')
-rw-r--r--tools/xenpaging/xenpaging.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/tools/xenpaging/xenpaging.h b/tools/xenpaging/xenpaging.h
new file mode 100644
index 0000000000..6d1a6f74a2
--- /dev/null
+++ b/tools/xenpaging/xenpaging.h
@@ -0,0 +1,72 @@
+/******************************************************************************
+ * tools/xenpaging/xenpaging.h
+ *
+ * Xen domain paging.
+ *
+ * Copyright (c) 2009 Citrix (R&D) Inc. (Patrick Colp)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+
+#ifndef __XEN_PAGING2_H__
+#define __XEN_PAGING2_H__
+
+
+#include "spinlock.h"
+#include "xc.h"
+#include <xc_private.h>
+
+#include <xen/event_channel.h>
+#include <xen/mem_event.h>
+
+#include "mem_event.h"
+
+
+typedef struct xenpaging {
+ int xc_handle;
+
+ xc_platform_info_t *platform_info;
+ xc_domaininfo_t *domain_info;
+
+ unsigned long bitmap_size;
+ unsigned long *bitmap;
+
+ mem_event_t mem_event;
+} xenpaging_t;
+
+
+typedef struct xenpaging_victim {
+ /* the domain to evict a page from */
+ domid_t domain_id;
+ /* the gfn of the page to evict */
+ unsigned long gfn;
+ /* the mfn of evicted page */
+ unsigned long mfn;
+} xenpaging_victim_t;
+
+
+#endif // __XEN_PAGING_H__
+
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */