redhat-performance / tuned

Tuning Profile Delivery Mechanism for Linux
GNU General Public License v2.0
814 stars 178 forks source link

Tuned CPU isolation not applied when child processes was created #564

Open x-coder-L opened 11 months ago

x-coder-L commented 11 months ago

Hello, we use cpu-partitioning profile and set isolate cpu. we want all running process will be restricted by isolate cpu.But we find some child processes are not inherit CPU affinity from their parents. We check the code in github and add the option perf_process_fork=true in /usr/lib/tuned/cpu-partitioning/tuned.conf , then exec tuned-adm profile cpu-partitioning again and reboot. But it still not worked. image image image image

yarda commented 11 months ago

Isn't possible the processes matches the blacklist regexes? Or the processes change their affinity? They are not restricted from doing so.

x-coder-L commented 11 months ago

@yarda we make sure this processes are not matches the blacklist regexes. we think is the isolate cpus restricted just running once when we apply this profiles, because when we apply this profile or restart tuned.service the processes will change their affinity to non-isolate affinity. we check the plugin_scheduler.py code and find if we set group_name and perf_process_fork=true in tuned.conf, and make restricted in group_name 's affinity it's seems like will restricted all processes when tuned.service is running. Because just the _thread_code function will listen to perf event which _isolate_core function is not. We think it's maybe a bug? If we just want to use isolate cpu to restricted all processes in our device, it will not make restricted to processes which start after tuned.service