summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/lib/oe/utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index 7982b2b511..136650e6f7 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -248,9 +248,9 @@ def trim_version(version, num_parts=2):
248 trimmed = ".".join(parts[:num_parts]) 248 trimmed = ".".join(parts[:num_parts])
249 return trimmed 249 return trimmed
250 250
251def cpu_count(at_least=1): 251def cpu_count(at_least=1, at_most=64):
252 cpus = len(os.sched_getaffinity(0)) 252 cpus = len(os.sched_getaffinity(0))
253 return max(cpus, at_least) 253 return max(min(cpus, at_most), at_least)
254 254
255def execute_pre_post_process(d, cmds): 255def execute_pre_post_process(d, cmds):
256 if cmds is None: 256 if cmds is None: