Does the kernel assign CPU affinity automatically?

Eugene Grosbein eugen at grosbein.net
Fri Jan 19 20:40:03 UTC 2018


20.01.2018 2:03, Yuri wrote:

> I noticed that my particularly large process always runs on the same CPU through its lifetime (based on top).

You should not trust your eyes looking at top(1) output because
scheduler quantum is pretty short and a process can be switched
many times per second between top's screen updates.

Instead, you should use sysctl kern.cp_times providing detailed
ever incrementing counters for per-core idle/kernel/interrupt/nice/normal ticks
(ticks have 1/stathz frequency, see sysctl kern.clockrate) to draw graphs or
make comparisons. They allow you to check if such heavy process makes even load
on every CPU core or not.



More information about the freebsd-hackers mailing list