My process has one high frequency thread and several low frequency threads. I want to bind the high frequency thread A on an isolated cpu 18 (of NUMA node 0), and other low frequency threads on other non-isolated cpu cores(0,2,4,6,8,10,12,14,16,24,26,28,30) of NUMA node 0.
My machine has 32 cores, numa node 0: 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30 numa node 1: 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31
Firstly, I set the grub booting parameters for isolating CPU cores 17-22:
isolcpus=17,18,19,20,21,22 nohz_full=17,18,19,20,21,22
Secondly, in the code of thread A(high frequency thread), I bind the thread on core 18 by calling API sched_setaffinity(...)
.
And then, I start my program by numactl
command
numactl --cpunodebind=0 --membind=0 ./myprogram.sh
Unfortunately, it didn't work expectedly. The low frequency threads all allocated on the isolated core 18. And I check the /proc/thread-id/status
, the Allowed Cpu includes all nodes of numa 0, which should excludes the isolated cores 18, 20, 22.
I'm grateful if you would help me. Thanks a lot.
high frequency thread A runs on an isolated cpu 18 (of NUMA node 0), and other low frequency threads run on other non-isolated cpu cores(0,2,4,6,8,10,12,14,16,24,26,28,30) of NUMA node 0.