Make CPULimitedHost method sig friendlier, and make 'cfs' default sched.
This commit is contained in:
+3
-3
@@ -506,14 +506,14 @@ class CPULimitedHost( Host ):
|
|||||||
|
|
||||||
"CPU limited host"
|
"CPU limited host"
|
||||||
|
|
||||||
def __init__( self, *args, **kwargs ):
|
def __init__( self, name, sched='cfs', **kwargs ):
|
||||||
Host.__init__( self, *args, **kwargs )
|
Host.__init__( self, name, **kwargs )
|
||||||
# Create a cgroup and move shell into it
|
# Create a cgroup and move shell into it
|
||||||
self.cgroup = 'cpu,cpuacct:/' + self.name
|
self.cgroup = 'cpu,cpuacct:/' + self.name
|
||||||
errFail( 'cgcreate -g ' + self.cgroup )
|
errFail( 'cgcreate -g ' + self.cgroup )
|
||||||
errFail( 'cgclassify -g %s %s' % ( self.cgroup, self.pid ) )
|
errFail( 'cgclassify -g %s %s' % ( self.cgroup, self.pid ) )
|
||||||
self.period_us = kwargs.get( 'period_us', 10000 )
|
self.period_us = kwargs.get( 'period_us', 10000 )
|
||||||
self.sched = kwargs.get( 'sched', 'rt' )
|
self.sched = sched
|
||||||
|
|
||||||
def cleanup( self ):
|
def cleanup( self ):
|
||||||
"Clean up our cgroup"
|
"Clean up our cgroup"
|
||||||
|
|||||||
Reference in New Issue
Block a user