Ejemplo n.º 1
0
class SubsystemCpuset(Subsystem):
    NAME = 'cpuset'
    STATS = {
        'memory_pressure': long,
    }
    CONFIGS = {
        'cpu_exclusive': 0,
        # str object something like '0', '0-1', and '0-1,3,4'
        'cpus': host.CPUInfo().get_online(),
        'mem_exclusive': 0,
        'mem_hardwall': 0,
        'memory_migrate': 0,
        'memory_pressure_enabled': 0,
        'memory_spread_page': 0,
        'memory_spread_slab': 0,
        # same as 'cpus'
        'mems': host.MemInfo().get_online(),
        'sched_load_balance': 1,
        'sched_relax_domain_level': -1,
    }

    def get_init_parameters(self, parent_configs):
        params = {}
        params['cpus'] = parent_configs['cpus']
        params['mems'] = parent_configs['mems']
        return params
Ejemplo n.º 2
0
    def __init__(self, options):
        self.options = options

        self.hostcpuinfo = host.CPUInfo()

        self.deltas = {}
        self.prevs = {}

        self.deltas['cpu'] = 0
        self.deltas['time'] = 0

        self.cgroups = {}
        self._update_cgroups()
        self.last_update_cgroups = time.time()