From 4f8aa1d8a0633f8f6121dd20ca42ac3605e61a95 Mon Sep 17 00:00:00 2001 From: Bob Lantz <rlantz@cs.stanford.edu> Date: Wed, 5 Nov 2014 16:39:27 -0800 Subject: [PATCH] Don't check rt_runtime_us for CFS scheduler --- mininet/node.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mininet/node.py b/mininet/node.py index f4aa8cf6..73fe8307 100644 --- a/mininet/node.py +++ b/mininet/node.py @@ -674,14 +674,14 @@ def popen( self, *args, **kwargs ): # Tell mnexec to execute command in our cgroup mncmd = [ 'mnexec', '-g', self.name, '-da', str( self.pid ) ] - cpuTime = int( self.cgroupGet( 'rt_runtime_us', 'cpu' ) ) # if our cgroup is not given any cpu time, # we cannot assign the RR Scheduler. - if self.sched == 'rt' and cpuTime > 0: - mncmd += [ '-r', str( self.rtprio ) ] - elif self.sched == 'rt' and cpuTime <= 0: - debug( '***error: not enough cpu time available for %s.' % self.name, - 'Using cfs scheduler for subprocess\n' ) + if self.sched == 'rt': + if int( self.cgroupGet( 'rt_runtime_us', 'cpu' ) ) <= 0: + mncmd += [ '-r', str( self.rtprio ) ] + else: + debug( '*** error: not enough cpu time available for %s.' % self.name, + 'Using cfs scheduler for subprocess\n' ) return Host.popen( self, *args, mncmd=mncmd, **kwargs ) def cleanup( self ): -- GitLab