[pve-devel] [PATCH 3/3] remove old openvz fairscheduler code

Alexandre Derumier aderumier at odiso.com
Thu May 28 12:28:30 CEST 2015


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/QemuServer.pm | 87 -------------------------------------------------------
 1 file changed, 87 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index a8177d7..bf0792f 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -119,78 +119,6 @@ sub cgroups_path {
    return $vm_path;
 }
 
-unless(defined(&_VZSYSCALLS_H_)) {
-    eval 'sub _VZSYSCALLS_H_ () {1;}' unless defined(&_VZSYSCALLS_H_);
-    require 'sys/syscall.ph';
-    if(defined(&__x86_64__)) {
-	eval 'sub __NR_fairsched_vcpus () {499;}' unless defined(&__NR_fairsched_vcpus);
-	eval 'sub __NR_fairsched_mknod () {504;}' unless defined(&__NR_fairsched_mknod);
-	eval 'sub __NR_fairsched_rmnod () {505;}' unless defined(&__NR_fairsched_rmnod);
-	eval 'sub __NR_fairsched_chwt () {506;}' unless defined(&__NR_fairsched_chwt);
-	eval 'sub __NR_fairsched_mvpr () {507;}' unless defined(&__NR_fairsched_mvpr);
-	eval 'sub __NR_fairsched_rate () {508;}' unless defined(&__NR_fairsched_rate);
-	eval 'sub __NR_setluid () {501;}' unless defined(&__NR_setluid);
-	eval 'sub __NR_setublimit () {502;}' unless defined(&__NR_setublimit);
-    }
-    elsif(defined( &__i386__) ) {
-	eval 'sub __NR_fairsched_mknod () {500;}' unless defined(&__NR_fairsched_mknod);
-	eval 'sub __NR_fairsched_rmnod () {501;}' unless defined(&__NR_fairsched_rmnod);
-	eval 'sub __NR_fairsched_chwt () {502;}' unless defined(&__NR_fairsched_chwt);
-	eval 'sub __NR_fairsched_mvpr () {503;}' unless defined(&__NR_fairsched_mvpr);
-	eval 'sub __NR_fairsched_rate () {504;}' unless defined(&__NR_fairsched_rate);
-	eval 'sub __NR_fairsched_vcpus () {505;}' unless defined(&__NR_fairsched_vcpus);
-	eval 'sub __NR_setluid () {511;}' unless defined(&__NR_setluid);
-	eval 'sub __NR_setublimit () {512;}' unless defined(&__NR_setublimit);
-    } else {
-	die("no fairsched syscall for this arch");
-    }
-    require 'asm/ioctl.ph';
-    eval 'sub KVM_GET_API_VERSION () { &_IO(0xAE, 0x);}' unless defined(&KVM_GET_API_VERSION);
-}
-
-sub fairsched_mknod {
-    my ($parent, $weight, $desired) = @_;
-
-    return syscall(&__NR_fairsched_mknod, int($parent), int($weight), int($desired));
-}
-
-sub fairsched_rmnod {
-    my ($id) = @_;
-
-    return syscall(&__NR_fairsched_rmnod, int($id));
-}
-
-sub fairsched_mvpr {
-    my ($pid, $newid) = @_;
-
-    return syscall(&__NR_fairsched_mvpr, int($pid), int($newid));
-}
-
-sub fairsched_vcpus {
-    my ($id, $vcpus) = @_;
-
-    return syscall(&__NR_fairsched_vcpus, int($id), int($vcpus));
-}
-
-sub fairsched_rate {
-    my ($id, $op, $rate) = @_;
-
-    return syscall(&__NR_fairsched_rate, int($id), int($op), int($rate));
-}
-
-use constant FAIRSCHED_SET_RATE  => 0;
-use constant FAIRSCHED_DROP_RATE => 1;
-use constant FAIRSCHED_GET_RATE  => 2;
-
-sub fairsched_cpulimit {
-    my ($id, $limit) = @_;
-
-    my $cpulim1024 = int($limit * 1024 / 100);
-    my $op = $cpulim1024 ? FAIRSCHED_SET_RATE : FAIRSCHED_DROP_RATE;
-
-    return fairsched_rate($id, $op, $cpulim1024);
-}
-
 my $nodename = PVE::INotify::nodename();
 
 mkdir "/etc/pve/nodes/$nodename";
@@ -3200,19 +3128,6 @@ sub config_to_command {
 	}
     }
 
-    # hack: virtio with fairsched is unreliable, so we do not use fairsched
-    # when the VM uses virtio devices.
-    if (!$use_virtio && $have_ovz) {
-
-	my $cpuunits = defined($conf->{cpuunits}) ?
-	    $conf->{cpuunits} : $defaults->{cpuunits};
-
-	push @$cmd, '-cpuunits', $cpuunits if $cpuunits;
-
-	# fixme: cpulimit is currently ignored
-	#push @$cmd, '-cpulimit', $conf->{cpulimit} if $conf->{cpulimit};
-    }
-
     # add custom args
     if ($conf->{args}) {
 	my $aa = PVE::Tools::split_args($conf->{args});
@@ -4456,7 +4371,6 @@ sub vm_stop_cleanup {
 
     eval {
 	cgroups_delete("cpu", $vmid);
-	fairsched_rmnod($vmid); # try to destroy group
 
 	if (!$keepActive) {
 	    my $vollist = get_vm_volumes($conf);
@@ -4613,7 +4527,6 @@ sub vm_destroy {
 
 	if (!check_running($vmid)) {
 	    cgroups_delete("cpu", $vmid);
-	    fairsched_rmnod($vmid); # try to destroy group
 	    destroy_vm($storecfg, $vmid);
 	} else {
 	    die "VM $vmid is running - destroy failed\n";
-- 
2.1.4




More information about the pve-devel mailing list