MCPcopy Create free account
hub / github.com/mininet/mininet / initCgroups

Method initCgroups

mininet/node.py:699–714  ·  view source on GitHub ↗

Deferred cgroup initialization

( self )

Source from the content-addressed store, hash-verified

697 self.cgroup, self.rtprio = None, None
698
699 def initCgroups( self ):
700 "Deferred cgroup initialization"
701 if self.cgroupsInited:
702 return
703 # Initialize class if necessary
704 if not CPULimitedHost.inited:
705 CPULimitedHost.init()
706 # Create a cgroup and move shell into it
707 self.cgroup = 'cpu,cpuacct,cpuset:/' + self.name
708 errFail( 'cgcreate -g ' + self.cgroup )
709 # We don't add ourselves to a cpuset because you must
710 # specify the cpu and memory placement first
711 errFail( 'cgclassify -g cpu,cpuacct:/%s %s' % ( self.name, self.pid ) )
712 if self.sched == 'rt':
713 self.checkRtGroupSched()
714 self.rtprio = 20
715
716 def cgroupSet( self, param, value, resource='cpu' ):
717 "Set a cgroup parameter and return its value"

Callers 1

configMethod · 0.95

Calls 3

checkRtGroupSchedMethod · 0.95
errFailFunction · 0.90
initMethod · 0.45

Tested by

no test coverage detected