Deferred cgroup initialization
( self )
| 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" |
no test coverage detected