@staticmethod
def classify(config, controller, cgname, pid_list, sticky=False,
- cancel_sticky=False, ignore_systemd=False):
+ cancel_sticky=False, ignore_systemd=False, replace_idle=False):
cmd = list()
if not config.args.container:
cmd.append('sudo')
cmd.append(Cgroup.build_cmd_path('cgclassify'))
+ if replace_idle:
+ cmd.append('-r')
+
if ignore_systemd:
cmd.append('-b')
cgclassify=True, ignore_systemd=False, replace_idle=False):
if cgclassify:
child_pid = self.create_process(config)
- Cgroup.classify(config, controller, cgname, child_pid, ignore_systemd=ignore_systemd)
+ Cgroup.classify(config, controller, cgname, child_pid,
+ ignore_systemd=ignore_systemd, replace_idle=replace_idle)
else:
# use cgexec
thread.start()
def create_threaded_process_in_cgroup(self, config, controller, cgname,
- threads=2, cgclassify=True, ignore_systemd=False):
+ threads=2, cgclassify=True, ignore_systemd=False,
+ replace_idle=False):
p = mp.Process(target=self.create_threaded_process,
args=(config, threads, ))
p.start()
if cgclassify:
- Cgroup.classify(config, controller, cgname, p.pid, ignore_systemd=ignore_systemd)
+ Cgroup.classify(config, controller, cgname, p.pid,
+ ignore_systemd=ignore_systemd, replace_idle=replace_idle)
self.children.append(p)
self.children_pids.append(p.pid)