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

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


Author: dietmar
Date: 2011-09-06 12:42:04 +0200 (Tue, 06 Sep 2011)
New Revision: 6530

Modified:
   pve-manager/trunk/ChangeLog
   pve-manager/trunk/configure.in
   pve-manager/trunk/debian/changelog.Debian
   pve-manager/trunk/lib/PVE/OpenVZ.pm
Log:
fix uptime display for 2.6.32 kernel with 1000HZ



Modified: pve-manager/trunk/ChangeLog
===================================================================
--- pve-manager/trunk/ChangeLog	2011-09-06 09:58:20 UTC (rev 6529)
+++ pve-manager/trunk/ChangeLog	2011-09-06 10:42:04 UTC (rev 6530)
@@ -1,3 +1,7 @@
+2011-09-06  Proxmox Support Team  <support at proxmox.com>
+
+	* lib/PVE/OpenVZ.pm (vmlist): compute kernel HZ
+
 2011-08-31  Proxmox Support Team  <support at proxmox.com>
 
 	* lib/PVE/Config.pm (read_vzconfig): make parser working with

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

Modified: pve-manager/trunk/debian/changelog.Debian
===================================================================
--- pve-manager/trunk/debian/changelog.Debian	2011-09-06 09:58:20 UTC (rev 6529)
+++ pve-manager/trunk/debian/changelog.Debian	2011-09-06 10:42:04 UTC (rev 6530)
@@ -1,3 +1,9 @@
+pve-manager (1.8-21) unstable; urgency=low
+
+  * fix uptime display for 2.6.32 kernel with 1000HZ
+
+ -- Proxmox Support Team <support at proxmox.com>  Tue, 06 Sep 2011 12:41:07 +0200
+
 pve-manager (1.8-20) unstable; urgency=low
 
   * support newer vzctl versions.

Modified: pve-manager/trunk/lib/PVE/OpenVZ.pm
===================================================================
--- pve-manager/trunk/lib/PVE/OpenVZ.pm	2011-09-06 09:58:20 UTC (rev 6529)
+++ pve-manager/trunk/lib/PVE/OpenVZ.pm	2011-09-06 10:42:04 UTC (rev 6530)
@@ -101,6 +101,11 @@
     my $cpuinfo = PVE::Utils::get_cpu_info();
     my $cpus = $cpuinfo->{cpus} || 1;
 
+    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>)) {
@@ -113,11 +118,7 @@
 		my $sum = $8*$cpus; # uptime in jiffies * cpus = available jiffies
 		my $used = $9; # used time in jiffies
 
-		# HZ is 250 in our kernel 2.6.24 kernel
-		# but HZ is 1000 in our kernel 2.6.18 kernel
-		my $hz = 250; 
-		$hz = 1000 if $kernel_version && $kernel_version =~ m/^2.6.18/;
-		my $uptime = int ($ut / $hz); # HZ is 250 in our kernel
+		my $uptime = int ($ut / $hz);
 
 		my $d = $res->{"VEID_$veid"};
 		next if !$d;



More information about the pve-devel mailing list