util: Consider process CPU affinity when setting number of CPUs
While the system might have a certain number of CPUs online, the process might be restricted to a subset of those CPUs (via sched_setaffinity
). Take that into consideration when calculating the number of CPUs.
This affects llvmpipe, zink, u_threaded_context, and threaded compiles in radeonsi.
At some point, we'll likely want to consider "big" cores vs. "little" cores for at least some of these users.
I came across this while working on threaded compile support for iris (!11229 (merged)).