diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2009-06-01 18:37:27 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2009-06-01 18:37:27 +0100 |
commit | d2c78b31b503e88c2cde80e7f15ec62061007e71 (patch) | |
tree | f482a7b6dbf55537a4a661d6b47d5a732689a1eb /tools/misc | |
parent | cf57498e90452b5042026b841a549993d5c28523 (diff) | |
download | xen-d2c78b31b503e88c2cde80e7f15ec62061007e71.tar.gz xen-d2c78b31b503e88c2cde80e7f15ec62061007e71.tar.bz2 xen-d2c78b31b503e88c2cde80e7f15ec62061007e71.zip |
tmem: shared ephemeral (SE) pool (clustering) fixes
Tmem can share clean page cache pages for Linux domains
in a virtual cluster (currently only the ocfs2 filesystem
has a patch on the Linux side). So when one domain
"puts" (evicts) a page, any domain in the cluster can
"get" it, thus saving disk reads. This functionality
is already present; these are only bug fixes.
- fix bugs when an SE pool is destroyed
- fixes in parsing tool for xm tmem-list output for SE pools
- incorrect locking in one case for destroying an SE pool
- clearer verbosity for transfer when an SE pool is destroyed
- minor cleanup: merge routines that are mostly duplicate
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Diffstat (limited to 'tools/misc')
-rw-r--r-- | tools/misc/xen-tmem-list-parse.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/tools/misc/xen-tmem-list-parse.c b/tools/misc/xen-tmem-list-parse.c index 383daee158..51ffe44fd2 100644 --- a/tools/misc/xen-tmem-list-parse.c +++ b/tools/misc/xen-tmem-list-parse.c @@ -29,6 +29,20 @@ unsigned long long parse(char *s,char *match) return ret; } +unsigned long long parse_hex(char *s,char *match) +{ + char *s1 = strstr(s,match); + unsigned long long ret; + + if ( s1 == NULL ) + return 0LL; + s1 += 2; + if ( *s1++ != ':' ) + return 0LL; + sscanf(s1,"%llx",&ret); + return ret; +} + unsigned long long parse2(char *s,char *match1, char *match2) { char match[3]; @@ -64,7 +78,7 @@ void parse_sharers(char *s, char *match, char *buf, int len) s1 += 2; if (*s1++ != ':') return; - while (*s1 <= '0' && *s1 <= '9') + while (*s1 >= '0' && *s1 <= '9') *b++ = *s1++; *b++ = ','; s1 = strstr(s1,match); @@ -196,6 +210,8 @@ void parse_pool(char *s) unsigned long long flush_objs = parse(s,"ot"); parse_string(s,"PT",pool_type,2); + if (pool_type[1] == 'S') + return; /* no need to repeat print data for shared pools */ printf("domid%lu,id%lu[%s]:pgp=%llu(max=%llu) obj=%llu(%llu) " "objnode=%llu(%llu) puts=%llu/%llu/%llu(dup=%llu/%llu) " "gets=%llu/%llu(%llu%%) " @@ -216,8 +232,8 @@ void parse_shared_pool(char *s) char pool_type[3]; char buf[BUFSIZE]; unsigned long pool_id = parse(s,"PI"); - unsigned long long uid0 = parse(s,"U0"); - unsigned long long uid1 = parse(s,"U1"); + unsigned long long uid0 = parse_hex(s,"U0"); + unsigned long long uid1 = parse_hex(s,"U1"); unsigned long long pgp_count = parse(s,"Pc"); unsigned long long max_pgp_count = parse(s,"Pm"); unsigned long long obj_count = parse(s,"Oc"); @@ -238,7 +254,7 @@ void parse_shared_pool(char *s) parse_string(s,"PT",pool_type,2); parse_sharers(s,"SC",buf,BUFSIZE); - printf("poolid=%lu[%s] uuid=%llu.%llu, shared-by:%s: " + printf("poolid=%lu[%s] uuid=%llx.%llx, shared-by:%s: " "pgp=%llu(max=%llu) obj=%llu(%llu) " "objnode=%llu(%llu) puts=%llu/%llu/%llu(dup=%llu/%llu) " "gets=%llu/%llu(%llu%%) " |