aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_private.h
diff options
context:
space:
mode:
authorKeir Fraser <keir@xensource.com>2007-02-24 14:48:17 +0000
committerKeir Fraser <keir@xensource.com>2007-02-24 14:48:17 +0000
commite0b421d24279d3cce426c0df4bf6d8734c6ce325 (patch)
tree1c085426682541ba5f472f51948d2f61d3ff0372 /tools/libxc/xc_private.h
parent6948b541999a27d5dbf3cfe05b41d34ed3765ce8 (diff)
downloadxen-e0b421d24279d3cce426c0df4bf6d8734c6ce325.tar.gz
xen-e0b421d24279d3cce426c0df4bf6d8734c6ce325.tar.bz2
xen-e0b421d24279d3cce426c0df4bf6d8734c6ce325.zip
Reduce impact of saving/restoring/dumping large domains on Dom0 memory
usage by means of fadvise64() to tell the OS to discard the cache pages used for the save/dump file. Signed-off-by: Simon Graham <Simon.Graham@stratus.com>
Diffstat (limited to 'tools/libxc/xc_private.h')
-rw-r--r--tools/libxc/xc_private.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index 7705063326..13935d361b 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -41,6 +41,13 @@
#define INFO 1
#define PROGRESS 0
+/*
+** Define max dirty page cache to permit during save/restore -- need to balance
+** keeping cache usage down with CPU impact of invalidating too often.
+** (Currently 16MB)
+*/
+#define MAX_PAGECACHE_USAGE (4*1024)
+
#if INFO
#define IPRINTF(_f, _a...) printf(_f , ## _a)
#else
@@ -158,4 +165,7 @@ int xc_waitdomain_core(int xc_handle, int domain, int *status,
void bitmap_64_to_byte(uint8_t *bp, const uint64_t *lp, int nbits);
void bitmap_byte_to_64(uint64_t *lp, const uint8_t *bp, int nbits);
+/* Optionally flush file to disk and discard page cache */
+int discard_file_cache(int fd, int flush);
+
#endif /* __XC_PRIVATE_H__ */