So far my application requests the list of isolated cpu in its configuration file. Then it uses pthread_setaffinity_np()
in order to force running on that kind of cpu. Usually the guy who made the configuration file goes into the file /boot/grub/menu.lst
and pick the correct entry, in order to know what is the current list of isolated cpu.
title CentOS (2.6.32-431.5.1.el6.x86_64)
root (hd0,1)
kernel ... isolcpus=4-15
So, I would like to avoid the guy to have to enter that list manually in the configuration file. Is there a possible way for my application to get that list programatically?
cat /sys/devices/system/cpu/isolated
Only in a very backwards way - /proc/cmdline has the current kernel command line which you can parse to get the parameters the kernel was booted with, including isolcpus
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With