Skip to contentSkip to conversation

fix abnormal value cpu(%) when domain shutdown.

PATCH New Atsushi SAKAI 1 participant 1 message Aug 7, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix abnormal value cpu(%) when domain shutdown.

Hi,

This patch intends to fix the xentop cpu(%).
If we test multiple domain create/shutdown many times. sometimes abnormal values of cpu(%) are appeared. This is because shutdown domain remove failure.
(in other words, memory corruption of struct )
This corruption makes abnormal cpu(%) values are shown xentop sometimes.

===example of problem===

NAME STATE CPU(sec) CPU(%) MEM(k) MEM(%) MAXMEM(k) MAXMEM(%) VCPUS NETS NETTX(k) NETRX(k) VBDS VBD_OO VBD_RD VBD_WR SSID
Domain-0 -----r 332 0.7 988128 11.8 1048576
12.5 4 0 0 0 0 0 0 0 0
PVdomain.1 -----r 101 100.5 988160 11.8 1048576
12.5 4 0 0 0 1 0 0 0 0
PVdomain.2 -----r 149 200.4 988160 11.8 1048576

12.5     4    0        0        0    1        0       12        0    0    
temp.1 -----r         35  100.5     463872    5.5     524288       6.3     4  

0 0 0 1 0 0 0 0
temp.2 -----r 19 200.4 463872 5.5 524288 6.3 4
0 0 0 1 0 12 0 0
NAME STATE CPU(sec) CPU(%) MEM(k) MEM(%) MAXMEM(k) MAXMEM(%)
VCPUS NETS NETTX(k) NETRX(k) VBDS VBD_OO VBD_RD VBD_WR SSID
Domain-0 -----r 333 26.7 988128 11.8 1048576 12.5
4 0 0 0 0 0 0 0 0
======Problem event
***PVdomain.1 d----- 103 529379705092.7 16 0.0 1048576
12.5 4 0 0 0 1 0 12 0 0
======Problem event
PVdomain.2 -----r 156 200.9 988160 11.8 1048576 12.5
4 0 0 0 0 0 0 0 0
temp.1 -----r 39 101.4 463872 5.5 524288 6.3 4
0 0 0 1 0 0 0 0
NAME STATE CPU(sec) CPU(%) MEM(k) MEM(%) MAXMEM(k) MAXMEM(%) VCPUS
NETS NETTX(k) NETRX(k) VBDS VBD_OO VBD_RD VBD_WR SSID
Domain-0 -----r 334 33.7 988128 11.8 1048576 12.5
4 0 0 0 0 0 0 0 0
PVdomain.2 -----r 162 1890.8 988160 11.8 1048576 12.5
4 0 0 0 1 0 12 0 0
temp.1 -----r 42 100.8 463872 5.5 524288 6.3 4
0 0 0 1 0 0 0 0
temp.2 -----r 32 0.0 463872 5.5 524288 6.3
4 0 0 0 1 0 12 0 0

Thanks
Atsushi SAKAI

tools/xenstat/libxenstat/src/xenstat.c +1 -1
diff -r 039f2ccb1e38 tools/xenstat/libxenstat/src/xenstat.c
@@ -677,7 +677,7 @@ static void xenstat_prune_domain(xenstat
 	/* shift entries following specified entry up by one */
 	if (entry < node->num_domains) {
 		xenstat_domain *domain = &node->domains[entry];
-		memmove(domain,domain+1,node->num_domains-entry);
+		memmove(domain,domain+1,(node->num_domains - entry) * sizeof(xenstat_domain) );
 	}
 
 	/* zero out original last entry from node -- not

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel