|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] Tools: Expose to libxc the total number of shared frames and space saved
# HG changeset patch
# User Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>
# Date 1327581986 0
# Node ID 1a3e534cd11e7ed93ccd98b892a8c255c2d05287
# Parent 3822ed1804623555f9e05ba7e8bf5fa2430cebcb
Tools: Expose to libxc the total number of shared frames and space saved
Signed-off-by: Adin Scannell <adin@xxxxxxxxxxx>
Signed-off-by: Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>
Committed-by: Tim Deegan <tim@xxxxxxx>
---
diff -r 3822ed180462 -r 1a3e534cd11e tools/libxc/xc_memshr.c
--- a/tools/libxc/xc_memshr.c Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/libxc/xc_memshr.c Thu Jan 26 12:46:26 2012 +0000
@@ -225,3 +225,13 @@
return do_domctl(xch, &domctl);
}
+long xc_sharing_freed_pages(xc_interface *xch)
+{
+ return do_memory_op(xch, XENMEM_get_sharing_freed_pages, NULL, 0);
+}
+
+long xc_sharing_used_frames(xc_interface *xch)
+{
+ return do_memory_op(xch, XENMEM_get_sharing_shared_pages, NULL, 0);
+}
+
diff -r 3822ed180462 -r 1a3e534cd11e tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/libxc/xenctrl.h Thu Jan 26 12:46:26 2012 +0000
@@ -1228,6 +1228,23 @@
/* System wide memory properties */
long xc_maximum_ram_page(xc_interface *xch);
+/**
+ * This function returns the total number of pages freed by using sharing
+ * on the system. For example, if two domains contain a single entry in
+ * their p2m map that points to the same shared page (and no other pages
+ * in the system are shared), then this function should return 1.
+ */
+long xc_sharing_freed_pages(xc_interface *xch);
+
+/**
+ * This function returns the total number of frames occupied by shared
+ * pages on the system. This is independent of the number of domains
+ * pointing at these frames. For example, in the above scenario this
+ * should return 1. The following should hold:
+ * memory usage without sharing = freed_pages + used_frames
+ */
+long xc_sharing_used_frames(xc_interface *xch);
+
/* Get current total pages allocated to a domain. */
long xc_get_tot_pages(xc_interface *xch, uint32_t domid);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |