diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2010-04-06 07:11:48 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2010-04-06 07:11:48 +0100 |
commit | 38c433d0c711406778aba1ae183a195da98656f0 (patch) | |
tree | eaad27720c4cf4a2b69df8149bbe0a8b3151f0e4 /tools/misc/xen-tmem-list-parse.c | |
parent | 6a9ee8cf218b621ebc3d88e621f32cc3f030e742 (diff) | |
download | xen-38c433d0c711406778aba1ae183a195da98656f0.tar.gz xen-38c433d0c711406778aba1ae183a195da98656f0.tar.bz2 xen-38c433d0c711406778aba1ae183a195da98656f0.zip |
tmem: add page deduplication with optional compression or trailing-zero-elimination
Add "page deduplication" capability (with optional compression
and trailing-zero elimination) to Xen's tmem.
(Transparent to tmem-enabled guests.) Ephemeral pages
that have the exact same content are "combined" so that only
one page frame is needed. Since ephemeral pages are essentially
read-only, no C-O-W (and thus no equivalent of swapping) is
necessary. Deduplication can be combined with compression
or "trailing zero elimination" for even more space savings.
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Diffstat (limited to 'tools/misc/xen-tmem-list-parse.c')
-rw-r--r-- | tools/misc/xen-tmem-list-parse.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/tools/misc/xen-tmem-list-parse.c b/tools/misc/xen-tmem-list-parse.c index 35eeb9d314..977e4d3cc2 100644 --- a/tools/misc/xen-tmem-list-parse.c +++ b/tools/misc/xen-tmem-list-parse.c @@ -110,13 +110,39 @@ void parse_global(char *s) unsigned long long rtree_node_max = parse(s,"Nm"); unsigned long long pgp_count = parse(s,"Pc"); unsigned long long pgp_max = parse(s,"Pm"); + unsigned long long page_count = parse(s,"Fc"); + unsigned long long max_page_count = parse(s,"Fm"); + unsigned long long pcd_count = parse(s,"Sc"); + unsigned long long max_pcd_count = parse(s,"Sm"); + unsigned long long pcd_tot_tze_size = parse(s,"Zt"); + unsigned long long pcd_tot_csize = parse(s,"Gz"); + unsigned long long deduped_puts = parse(s,"Gd"); + unsigned long long tot_good_eph_puts = parse(s,"Ep"); printf("total tmem ops=%llu (errors=%llu) -- tmem pages avail=%llu\n", total_ops, errored_ops, avail_pages); printf("datastructs: objs=%llu (max=%llu) pgps=%llu (max=%llu) " - "nodes=%llu (max=%llu)\n", + "nodes=%llu (max=%llu) pages=%llu (max=%llu) ", obj_count, obj_max, pgp_count, pgp_max, - rtree_node_count, rtree_node_max); + rtree_node_count, rtree_node_max, + page_count,max_page_count); + if (max_pcd_count != 0 && global_eph_count != 0 && tot_good_eph_puts != 0) { + printf("pcds=%llu (max=%llu) ", + pcd_count,max_pcd_count); + printf("deduped: avg=%4.2f%% (curr=%4.2f%%) ", + ((deduped_puts*1.0)/tot_good_eph_puts)*100, + (1.0-(pcd_count*1.0)/global_eph_count)*100); + } + if (pcd_count != 0) + { + if (pcd_tot_tze_size && (pcd_tot_tze_size < pcd_count*PAGE_SIZE)) + printf("tze savings=%4.2f%% ", + (1.0-(pcd_tot_tze_size*1.0)/(pcd_count*PAGE_SIZE))*100); + if (pcd_tot_csize && (pcd_tot_csize < pcd_count*PAGE_SIZE)) + printf("compression savings=%4.2f%% ", + (1.0-(pcd_tot_csize*1.0)/(pcd_count*PAGE_SIZE))*100); + } + printf("\n"); printf("misc: failed_copies=%llu alloc_failed=%llu alloc_page_failed=%llu " "low_mem=%llu evicted=%llu/%llu relinq=%llu/%llu, " "max_evicts_per_relinq=%llu, flush_pools=%llu, " |