Branch: refs/heads/master
Home: https://github.com/tianocore/edk2
Commit: 7aaf742d2dc3f188b0307544cc767e6879df9c9e
https://github.com/tianocore/edk2/commit/7aaf742d2dc3f188b0307544cc767e6879df9c9e
Author: Ayden Meng <[email protected]>
Date: 2025-12-03 (Wed, 03 Dec 2025)
Changed paths:
M BaseTools/Source/Python/build/build.py
Log Message:
-----------
BaseTools: Handle file descriptor exhaustion during parallel build
Previously, when file descriptors were exhausted in high-concurrency
builds (e.g., 512 threads with 1024 FD limit), the build would hang or
fail silently without clear indication of the root cause.
This change catches relevant OSError instances and terminates the build,
ensuring failures due to resource limits are explicit.
Signed-off-by: Ayden Meng <[email protected]>
Commit: a058a2856dec7d3e837ca5034fe892c83bc8077e
https://github.com/tianocore/edk2/commit/a058a2856dec7d3e837ca5034fe892c83bc8077e
Author: Ayden Meng <[email protected]>
Date: 2025-12-03 (Wed, 03 Dec 2025)
Changed paths:
M BaseTools/Source/Python/build/build.py
Log Message:
-----------
BaseTools: Cap AutoGen thread count to avoid file descriptor exhaustion
When the number of build threads multiplied by per-thread file
descriptor usage exceeds the system's open file descriptor limit,
some threads may fail to acquire necessary resources (e.g., pipes
or semaphores), leading to deadlocks or hangs during parallel builds.
To prevent this situation, calculate the safety upper limit of
concurrency by dividing the system's maximum file descriptor limit by
3 (An empirical value derived from balancing performance overhead
against the theoretical number of file descriptors consumed per thread).
The actual thread count is then clamped to this safe value.
Other usages of ThreadNum()—such as during actual compilation or log
queue creation—do not significantly contribute to file descriptor
consumption. Therefore, adjusting ThreadNum() globally would be
unwarranted, as it could unnecessarily restrict parallelism in stages
that are not FD-bound.
This ensures stable parallel builds even under constrained resource
limits.
Signed-off-by: Ayden Meng <[email protected]>
Compare: https://github.com/tianocore/edk2/compare/53cca9ed9995...a058a2856dec
To unsubscribe from these emails, change your notification settings at
https://github.com/tianocore/edk2/settings/notifications
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits