2022-11-30 –, Langdale
Building images using bitbake can be a demanding task that is able to push a computer system beyond it's capacity. Recent bitbake scheduler changes that can be used to regulate task creation to make optimal use of a system without overwhelming it will be discussed.
Whether you are running a single large image build or your are trying to test as many configurations as possible to maximize testing throughput, bitbake can easily push many computer systems over their capacity limits. Bitbake already allows users to manually specify the number of tasks and parallel jobs, and has reasonable defaults but especially when running many builds, responsiveness of the system can be severely degraded.
By using a feature added to Linux in 4.20 called pressure stall information (PSI), one can limit bitbake task creation when PSI monitoring indicates that there is contention for system resources.
We will show that acceptable system responsiveness can be maintained without a substantial decrease in throughput. Limitations of load average regulation features that the 'make' and 'ninja' can use will be presented and plans to enhance these programs to use PSI will be discussed. Sensible values to use when setting the bitbake regulation variables: BB_PRESSURE_MAX_{CPU|IO|MEMORY} will be given based on a variety of tests.
Randy is a Senior Member of Technical Staff at Wind River Systems where he has worked for the last 12 years on a variety of tasks related to Wind River Linux and the Yocto Project.