Message ID | 20250624-improve-pressure-doc-v1-1-37170e441fc9@bootlin.com |
---|---|
State | New |
Headers | show |
Series | doc: bitbake-user-manual-ref-variables: improve BB_PRESSURE_* doc | expand |
Hi Antonin, On 6/24/25 2:25 PM, Antonin Godard via lists.openembedded.org wrote: > The current default value for BB_PRESSURE_MAX_CPU is 500, which is > really low for most systems. Provide a value of 15000 which limits the > load average without being extremely slow either. > > Provide similar values for BB_PRESSURE_MAX_IO and > BB_PRESSURE_MAX_MEMORY. Mention that these should be adjusted depending > on the need, and warn about the potential spam of messages when the > value is too low. > > Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> > --- > .../bitbake-user-manual-ref-variables.rst | 70 ++++++++++++++++++++-- > 1 file changed, 64 insertions(+), 6 deletions(-) > > diff --git a/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst b/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst > index 477443e228..f73e96f168 100644 > --- a/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst > +++ b/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst > @@ -533,11 +533,28 @@ overview of their function and contents. > version 4.20 expose under ``/proc/pressure``. The threshold represents > the difference in "total" pressure from the previous second. The > minimum value is 1.0 (extremely slow builds) and the maximum is > - 1000000 (a pressure value unlikely to ever be reached). > + 1000000 (a pressure value unlikely to ever be reached). See > + https://docs.kernel.org/accounting/psi.html for more information. > > - This threshold can be set in ``conf/local.conf`` as:: > + A default value to limit the CPU pressure to be set in ``conf/local.conf`` > + could be:: > > - BB_PRESSURE_MAX_CPU = "500" > + BB_PRESSURE_MAX_CPU = "15000" > + > + Multiple values should be tested on the build host to determine what suits > + best, depending on the need for performances versus load average during s/performances/performance/? > + the build. > + > + .. note:: > + > + You may see numerous messages printed by BitBake in the case the s/in the case/in case/ > + :term:`BB_PRESSURE_MAX_CPU` is too low: Did you want the next sentence to be a code-block (missing second colon) or does a quote work? (which I believe is what this would do, no code-block and text indented). Considering the other BB_PRESSURE_* have ::, I believe this is missing a second colon :) > + > + Pressure status changed to CPU: True, IO: False, Mem: False (CPU: 1105.9/2.0, IO: 0.0/2.0, Mem: 0.0/2.0) - using 1/64 bitbake threads > + > + This means that the :term:`BB_PRESSURE_MAX_CPU` should be increased to > + a reasonable value for limiting the CPU pressure on the system. > + Monitor the varying value after ``IO:`` above to set a sensible value. s/IO:/CPU:/ > > :term:`BB_PRESSURE_MAX_IO` > Specifies a maximum I/O pressure threshold, above which BitBake's > @@ -549,14 +566,34 @@ overview of their function and contents. > version 4.20 expose under ``/proc/pressure``. The threshold represents > the difference in "total" pressure from the previous second. The > minimum value is 1.0 (extremely slow builds) and the maximum is > - 1000000 (a pressure value unlikely to ever be reached). > + 1000000 (a pressure value unlikely to ever be reached). See > + https://docs.kernel.org/accounting/psi.html for more information. > > At this point in time, experiments show that IO pressure tends to > be short-lived and regulating just the CPU with > :term:`BB_PRESSURE_MAX_CPU` can help to reduce it. > > - :term:`BB_PRESSURE_MAX_MEMORY` > + A default value to limit the IO pressure to be set in ``conf/local.conf`` > + could be:: > + > + BB_PRESSURE_MAX_IO = "15000" > + > + Multiple values should be tested on the build host to determine what suits > + best, depending on the need for performances versus I/O usage during the s/performances/performance/ ? > + build. > + > + .. note:: > + > + You may see numerous messages printed by BitBake in the case the s/in the case/in case/ > + :term:`BB_PRESSURE_MAX_IO` is too low:: > > + Pressure status changed to CPU: None, IO: True, Mem: False (CPU: 2236.0/None, IO: 153.6/2.0, Mem: 0.0/2.0) - using 19/64 bitbake threads > + > + This means that the :term:`BB_PRESSURE_MAX_IO` should be increased to > + a reasonable value for limiting the I/O pressure on the system. > + Monitor the varying value after ``IO:`` above to set a sensible value. > + > + :term:`BB_PRESSURE_MAX_MEMORY` > Specifies a maximum memory pressure threshold, above which BitBake's > scheduler will not start new tasks (providing there is at least > one active task). If no value is set, memory pressure is not > @@ -566,7 +603,8 @@ overview of their function and contents. > version 4.20 expose under ``/proc/pressure``. The threshold represents > the difference in "total" pressure from the previous second. The > minimum value is 1.0 (extremely slow builds) and the maximum is > - 1000000 (a pressure value unlikely to ever be reached). > + 1000000 (a pressure value unlikely to ever be reached). See > + https://docs.kernel.org/accounting/psi.html for more information. > > Memory pressure is experienced when time is spent swapping, > refaulting pages from the page cache or performing direct reclaim. > @@ -574,6 +612,26 @@ overview of their function and contents. > might be useful as a last resort to prevent OOM errors if they are > occurring during builds. > > + A default value to limit the memory pressure to be set in > + ``conf/local.conf`` could be:: > + > + BB_PRESSURE_MAX_MEMORY = "15000" > + > + Multiple values should be tested on the build host to determine what suits > + best, depending on the need for performances versus memory consumption s/performances/performance/ ? > + during the build. > + > + .. note:: > + > + You may see numerous messages printed by BitBake in the case the s/in the case/in case/ Cheers, Quentin
diff --git a/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst b/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst index 477443e228..f73e96f168 100644 --- a/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst +++ b/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst @@ -533,11 +533,28 @@ overview of their function and contents. version 4.20 expose under ``/proc/pressure``. The threshold represents the difference in "total" pressure from the previous second. The minimum value is 1.0 (extremely slow builds) and the maximum is - 1000000 (a pressure value unlikely to ever be reached). + 1000000 (a pressure value unlikely to ever be reached). See + https://docs.kernel.org/accounting/psi.html for more information. - This threshold can be set in ``conf/local.conf`` as:: + A default value to limit the CPU pressure to be set in ``conf/local.conf`` + could be:: - BB_PRESSURE_MAX_CPU = "500" + BB_PRESSURE_MAX_CPU = "15000" + + Multiple values should be tested on the build host to determine what suits + best, depending on the need for performances versus load average during + the build. + + .. note:: + + You may see numerous messages printed by BitBake in the case the + :term:`BB_PRESSURE_MAX_CPU` is too low: + + Pressure status changed to CPU: True, IO: False, Mem: False (CPU: 1105.9/2.0, IO: 0.0/2.0, Mem: 0.0/2.0) - using 1/64 bitbake threads + + This means that the :term:`BB_PRESSURE_MAX_CPU` should be increased to + a reasonable value for limiting the CPU pressure on the system. + Monitor the varying value after ``IO:`` above to set a sensible value. :term:`BB_PRESSURE_MAX_IO` Specifies a maximum I/O pressure threshold, above which BitBake's @@ -549,14 +566,34 @@ overview of their function and contents. version 4.20 expose under ``/proc/pressure``. The threshold represents the difference in "total" pressure from the previous second. The minimum value is 1.0 (extremely slow builds) and the maximum is - 1000000 (a pressure value unlikely to ever be reached). + 1000000 (a pressure value unlikely to ever be reached). See + https://docs.kernel.org/accounting/psi.html for more information. At this point in time, experiments show that IO pressure tends to be short-lived and regulating just the CPU with :term:`BB_PRESSURE_MAX_CPU` can help to reduce it. - :term:`BB_PRESSURE_MAX_MEMORY` + A default value to limit the IO pressure to be set in ``conf/local.conf`` + could be:: + + BB_PRESSURE_MAX_IO = "15000" + + Multiple values should be tested on the build host to determine what suits + best, depending on the need for performances versus I/O usage during the + build. + + .. note:: + + You may see numerous messages printed by BitBake in the case the + :term:`BB_PRESSURE_MAX_IO` is too low:: + Pressure status changed to CPU: None, IO: True, Mem: False (CPU: 2236.0/None, IO: 153.6/2.0, Mem: 0.0/2.0) - using 19/64 bitbake threads + + This means that the :term:`BB_PRESSURE_MAX_IO` should be increased to + a reasonable value for limiting the I/O pressure on the system. + Monitor the varying value after ``IO:`` above to set a sensible value. + + :term:`BB_PRESSURE_MAX_MEMORY` Specifies a maximum memory pressure threshold, above which BitBake's scheduler will not start new tasks (providing there is at least one active task). If no value is set, memory pressure is not @@ -566,7 +603,8 @@ overview of their function and contents. version 4.20 expose under ``/proc/pressure``. The threshold represents the difference in "total" pressure from the previous second. The minimum value is 1.0 (extremely slow builds) and the maximum is - 1000000 (a pressure value unlikely to ever be reached). + 1000000 (a pressure value unlikely to ever be reached). See + https://docs.kernel.org/accounting/psi.html for more information. Memory pressure is experienced when time is spent swapping, refaulting pages from the page cache or performing direct reclaim. @@ -574,6 +612,26 @@ overview of their function and contents. might be useful as a last resort to prevent OOM errors if they are occurring during builds. + A default value to limit the memory pressure to be set in + ``conf/local.conf`` could be:: + + BB_PRESSURE_MAX_MEMORY = "15000" + + Multiple values should be tested on the build host to determine what suits + best, depending on the need for performances versus memory consumption + during the build. + + .. note:: + + You may see numerous messages printed by BitBake in the case the + :term:`BB_PRESSURE_MAX_MEMORY` is too low:: + + Pressure status changed to CPU: None, IO: False, Mem: True (CPU: 29.5/None, IO: 0.0/2.0, Mem: 2553.3/2.0) - using 17/64 bitbake threads + + This means that the :term:`BB_PRESSURE_MAX_MEMORY` should be increased to + a reasonable value for limiting the memory pressure on the system. + Monitor the varying value after ``Mem:`` above to set a sensible value. + :term:`BB_RUNFMT` Specifies the name of the executable script files (i.e. run files) saved into ``${``\ :term:`T`\ ``}``. By default, the
The current default value for BB_PRESSURE_MAX_CPU is 500, which is really low for most systems. Provide a value of 15000 which limits the load average without being extremely slow either. Provide similar values for BB_PRESSURE_MAX_IO and BB_PRESSURE_MAX_MEMORY. Mention that these should be adjusted depending on the need, and warn about the potential spam of messages when the value is too low. Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> --- .../bitbake-user-manual-ref-variables.rst | 70 ++++++++++++++++++++-- 1 file changed, 64 insertions(+), 6 deletions(-) --- base-commit: f1175778108a559e1dd0d55cb68f42816c86f393 change-id: 20250624-improve-pressure-doc-2e1f25f040f1 Best regards, -- Antonin Godard <antonin.godard@bootlin.com>