[pve-devel] r6531 - in pve-manager/trunk: . debian lib/PVE

svn-commits at proxmox.com svn-commits at proxmox.com
Tue Sep 6 14:14:42 CEST 2011


Author: dietmar
Date: 2011-09-06 14:14:41 +0200 (Tue, 06 Sep 2011)
New Revision: 6531

Modified:
   pve-manager/trunk/ChangeLog
   pve-manager/trunk/configure.in
   pve-manager/trunk/debian/changelog.Debian
   pve-manager/trunk/lib/PVE/OpenVZ.pm
Log:


Modified: pve-manager/trunk/ChangeLog
===================================================================
--- pve-manager/trunk/ChangeLog	2011-09-06 10:42:04 UTC (rev 6530)
+++ pve-manager/trunk/ChangeLog	2011-09-06 12:14:41 UTC (rev 6531)
@@ -1,6 +1,7 @@
 2011-09-06  Proxmox Support Team  <support at proxmox.com>
 
-	* lib/PVE/OpenVZ.pm (vmlist): compute kernel HZ
+	* lib/PVE/OpenVZ.pm (vmlist): compute uptime using cycles instead
+	of jiffies
 
 2011-08-31  Proxmox Support Team  <support at proxmox.com>
 

Modified: pve-manager/trunk/configure.in
===================================================================
--- pve-manager/trunk/configure.in	2011-09-06 10:42:04 UTC (rev 6530)
+++ pve-manager/trunk/configure.in	2011-09-06 12:14:41 UTC (rev 6531)
@@ -4,7 +4,7 @@
 
 prefix=/usr
 
-PACKAGERELEASE=21
+PACKAGERELEASE=22
 AC_SUBST(PACKAGERELEASE)
 
 REPOID=`svnversion .`

Modified: pve-manager/trunk/debian/changelog.Debian
===================================================================
--- pve-manager/trunk/debian/changelog.Debian	2011-09-06 10:42:04 UTC (rev 6530)
+++ pve-manager/trunk/debian/changelog.Debian	2011-09-06 12:14:41 UTC (rev 6531)
@@ -1,4 +1,4 @@
-pve-manager (1.8-21) unstable; urgency=low
+pve-manager (1.8-22) unstable; urgency=low
 
   * fix uptime display for 2.6.32 kernel with 1000HZ
 

Modified: pve-manager/trunk/lib/PVE/OpenVZ.pm
===================================================================
--- pve-manager/trunk/lib/PVE/OpenVZ.pm	2011-09-06 10:42:04 UTC (rev 6530)
+++ pve-manager/trunk/lib/PVE/OpenVZ.pm	2011-09-06 12:14:41 UTC (rev 6531)
@@ -100,12 +100,8 @@
 
     my $cpuinfo = PVE::Utils::get_cpu_info();
     my $cpus = $cpuinfo->{cpus} || 1;
+    my $cycles_per_second = $cpuinfo->{mhz}*1000000;
 
-    my $hz = 1000;
-    if ($cpuinfo->{mhz} && $cpuinfo->{cpus}) {
-	$hz = $cpuinfo->{cpu_cycles_per_jiffy}/($cpuinfo->{mhz}*$cpuinfo->{cpus});
-    }
-
     # see http://wiki.openvz.org/Vestat
     if ($fh = new IO::File ("/proc/vz/vestat", "r")) {
 	while (defined (my $line = <$fh>)) {
@@ -114,11 +110,11 @@
 		my $user = $2;
 		my $nice = $3;
 		my $system = $4;
-		my $ut = $5;
-		my $sum = $8*$cpus; # uptime in jiffies * cpus = available jiffies
-		my $used = $9; # used time in jiffies
+		my $ut = $8; # uptime in cycles
+		my $sum = $8*$cpus; # uptime in cycles * cpus = available cycles
+		my $used = $9; # used time in cycles
 
-		my $uptime = int ($ut / $hz);
+		my $uptime = int ($ut / $cycles_per_second);
 
 		my $d = $res->{"VEID_$veid"};
 		next if !$d;




More information about the pve-devel mailing list