Improve detection of CPU limits when running inside a Container
authorLudovic Henry <luhenry@microsoft.com>
Thu, 21 Mar 2019 21:37:14 +0000 (14:37 -0700)
committerLudovic Henry <luhenry@microsoft.com>
Fri, 22 Mar 2019 20:09:07 +0000 (13:09 -0700)
commit06d7406722011ccab83cd1d2507f0b14c7d91b0b
tree2bb5dd0f4f32f794ce5f33e83ae77aad3fc34632
parent29dc90c13a5d091c21e21e4ba5d3c4bcd3eab18d
Improve detection of CPU limits when running inside a Container

This focuse on better supporting `--cpuset-cpus` which limits the number of processors we have access to on the CPU; it also specifies which specific processor we have access to, but that’s irrelevant here

The work has been done here for all runtime components except `Environment.ProcessorCount`. The work consist in fixing `PAL_GetLogicalCpuCountFromOS` to use `sched_getaffinity`.

Fixes https://github.com/dotnet/coreclr/issues/22302
src/pal/src/misc/sysinfo.cpp