0

I want to run a benchmarks to test the scalability of my modified Linux kernel. The benchmark suite use a python script to call each benchmark. I have tried two methods.

  1. Using echo 0 > /sys/devices/system/cpu/cpu${i}/online to shut down some cores and then run the script. But other services and tasks still need to run on these cores, cause severe delay and jitter, especially for small core numbers.
  2. Using taskset -c 0-${core_num} ${cmd} to start the script, but the Python's multiprocessing.cpu_count() function will return the total core number of machine no matter I use taskset or not. Other tasks can also run in the specific cores, so it isn't a exclusive execution either.

I'm now trying to specify cores using cgroup filesystem, by mounting a dir under /sys/fs/cgroup/cpuset, writing core set to cpuset.cpus and writing numa node to cpuset.mems. However, if I want to use this set, I need to write pid into tasks file. Which means I have to run the script first and then get the pid number and write it to tasks file at last. But in my scenario, I may need to write the task file first, and than start the script, so that the script can get a correct core number(this operation is impossible). Are there any better ways? Thanks in advance.

Haoan
  • 71
  • 8

0 Answers0