From 83ca566aab6c56041eb575de11969d3eb535b542 Mon Sep 17 00:00:00 2001 From: Luc Provoost Date: Mon, 11 Nov 2024 14:16:25 +0100 Subject: New determination of the cpu set Check out https://github.com/kubernetes/kubernetes/issues/119669 That describes the problem. The solution can be found in this change. Signed-off-by: Luc Provoost Change-Id: Id4d47e5d36b1c4acefea8dbe13d7a1e7c499c70d --- VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py index 048895c1..63019e44 100644 --- a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py +++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py @@ -83,17 +83,7 @@ class RapidMachine(object): def read_cpuset(self): """Read list of cpus on which we allowed to execute """ - cpu_set_file = '/sys/fs/cgroup/cpuset.cpus' - cmd = 'test -e {0} && echo exists'.format(cpu_set_file) - if (self._client.run_cmd(cmd).decode().rstrip()): - cmd = 'cat {}'.format(cpu_set_file) - else: - cpu_set_file = '/sys/fs/cgroup/cpuset/cpuset.cpus' - cmd = 'test -e {0} && echo exists'.format(cpu_set_file) - if (self._client.run_cmd(cmd).decode().rstrip()): - cmd = 'cat {}'.format(cpu_set_file) - else: - RapidLog.critical('{Cannot determine cpuset') + cmd = "cat /proc/1/task/1/status | grep Cpus_allowed_list | awk '{print $2}'" cpuset_cpus = self._client.run_cmd(cmd).decode().rstrip() RapidLog.debug('{} ({}): Allocated cpuset: {}'.format(self.name, self.ip, cpuset_cpus)) self.cpu_mapping = self.expand_list_format(cpuset_cpus) -- cgit