Bug 14692

Summary: Use pressure stall information to stop queueing tasks
Product: [Build System, Metadata & Runtime] BitBake Reporter: Alexandre Belloni <alexandre.belloni>
Component: bitbakeAssignee: Randy MacLeod <randy.macleod>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Medium+ CC: Aryaman.Gupta, poky.bs.watcher, poky.watcher, randy.macleod, tvgamblin
Version: 4.1   
Target Milestone: 5.99   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)

Description Alexandre Belloni 2022-01-17 09:56:52 UTC
The kernel now exports the information on the pressure the system experiences in /proc/pressure.

It would be great to use that information and avoid starting new tasks when the cpu, memory or io pressure is too high.

A variable should allow the user to configure the threshold and behaviour, similar to what BB_DISKMON_DIRS does. However, a new action needs to be created as STOPTASKS will stop the build and we want the bitbake to resume starting tasks once the pressure goes down.
Comment 1 Randy MacLeod 2023-10-24 14:24:39 UTC
Bulk move from 4.99 or 0.00 to 5.99
Comment 2 Alexandre Belloni 2023-10-25 11:20:03 UTC
Does this need to be closed?
Comment 3 Randy MacLeod 2023-10-25 19:08:19 UTC
Fixed by a variety of commits:
https://git.openembedded.org/bitbake/log/?qt=grep&q=pressure

The main / first one being:

https://git.openembedded.org/bitbake/commit/?id=502e05cbe67fb7a0e804dcc2cc0764a2e05c014f

It needs some tuning in conjunction with he jobserver RFC posted here: 

https://lore.kernel.org/openembedded-core/20230828124834.376779-1-martin@geanix.com/#r

but it's useful and helpful as is.