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

svn-commits at proxmox.com svn-commits at proxmox.com
Thu Sep 8 12:45:58 CEST 2011


Author: dietmar
Date: 2011-09-08 12:45:57 +0200 (Thu, 08 Sep 2011)
New Revision: 6533

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


Modified: pve-manager/trunk/configure.in
===================================================================
--- pve-manager/trunk/configure.in	2011-09-07 05:31:30 UTC (rev 6532)
+++ pve-manager/trunk/configure.in	2011-09-08 10:45:57 UTC (rev 6533)
@@ -4,7 +4,7 @@
 
 prefix=/usr
 
-PACKAGERELEASE=22
+PACKAGERELEASE=23
 AC_SUBST(PACKAGERELEASE)
 
 REPOID=`svnversion .`

Modified: pve-manager/trunk/debian/changelog.Debian
===================================================================
--- pve-manager/trunk/debian/changelog.Debian	2011-09-07 05:31:30 UTC (rev 6532)
+++ pve-manager/trunk/debian/changelog.Debian	2011-09-08 10:45:57 UTC (rev 6533)
@@ -1,3 +1,10 @@
+pve-manager (1.8-23) unstable; urgency=low
+
+  * fix uptime display for 2.6.32 kernel with 1000HZ (revert
+  previous change, which does not work reliable).
+  
+ -- Proxmox Support Team <support at proxmox.com>  Thu, 08 Sep 2011 12:44:21 +0200
+
 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-07 05:31:30 UTC (rev 6532)
+++ pve-manager/trunk/lib/PVE/OpenVZ.pm	2011-09-08 10:45:57 UTC (rev 6533)
@@ -100,7 +100,12 @@
 
     my $cpuinfo = PVE::Utils::get_cpu_info();
     my $cpus = $cpuinfo->{cpus} || 1;
-    my $cycles_per_second = $cpuinfo->{mhz}*1000000;
+    my $hz = 1000;
+    if ($kernel_version) {
+	$hz = 250 if $kernel_version =~ m/^2.6.35/;
+	$hz = 250 if $kernel_version =~ m/^2.6.24/;
+	$hz = 250 if $kernel_version =~ m/^2.6.32-(\d+)-pve/ && ($1 < 6);
+    }
 
     # see http://wiki.openvz.org/Vestat
     if ($fh = new IO::File ("/proc/vz/vestat", "r")) {
@@ -110,11 +115,11 @@
 		my $user = $2;
 		my $nice = $3;
 		my $system = $4;
-		my $ut = $8; # uptime in cycles
+		my $ut = $5; # uptime in jiffies
 		my $sum = $8*$cpus; # uptime in cycles * cpus = available cycles
 		my $used = $9; # used time in cycles
 
-		my $uptime = int ($ut / $cycles_per_second);
+		my $uptime = int ($ut / $hz);
 
 		my $d = $res->{"VEID_$veid"};
 		next if !$d;



More information about the pve-devel mailing list