0

In a parallel programming library, we pin each process to a different core. However, we overlooked the fact that a given core might already be busy and have another CPU-intensive process already pinned to it. Is it possible to ask the Linux (and OS X) kernel to list all the cores which don't have a process pinned? I know how to pin a process to a core (sched_setaffinity on Linux). But, in a multi-user system, I'd like the kernel to tell me if it is a good idea to pin to that core. Or, even better, let the kernel decide to which core this process should be pinned to. Thanks!

daruma
  • 426
  • 1
  • 4
  • 8
  • 2
    In general GNU/Linux is quite good at scheduling. This can be seen when running a single 100% CPU process on an idle multicore machine. htop can show which core is busy, and it remains the same one for several seconds. Do you have any measurements that indicates that it can be done better? – Ole Tange Nov 30 '17 at 08:51
  • The implementors of the library found that core pinning significantly improve the performance. I agree that the natural CPU affinity of the Linux kernel is not bad, but sometimes it still shuffle processes around. – daruma Dec 01 '17 at 02:20

0 Answers0