-
Bug
-
Resolution: Fixed
-
Normal
-
None
-
None
-
None
The current version of portage, 2.3.47, relies on multiprocessing.cpu_count() to determine the number of cores, which under LXD can give the number of cores on the host regardless of the actual # of CPUs allocated to the container. Portage should use a method that involves looking at /proc/cpuinfo instead.
The problem code is in lib/portage/util/cpuinfo.py.
Example difference:
# python3 Python 3.6.6 (default, Dec 1 2018, 08:39:55) [GCC 7.3.1 20181104] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import multiprocessing >>> multiprocessing.cpu_count() 80
# cat /proc/cpuinfo | grep "^processor" | wc -l
8