diff options
| author | Antonin Godard <antonin.godard@bootlin.com> | 2025-06-24 14:25:02 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-06-26 11:02:55 +0100 |
| commit | 3546e9d522449ed960cbe35a68d60a7b0d077b89 (patch) | |
| tree | 784f531746a464d5090a1cb444e54eeca4d7b1c5 | |
| parent | e9754adb05962b9fae413a71054a2c1b777388cf (diff) | |
| download | poky-3546e9d522449ed960cbe35a68d60a7b0d077b89.tar.gz | |
bitbake: doc: bitbake-user-manual-ref-variables: improve BB_PRESSURE_* doc
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.
(Bitbake rev: 09baa527dafca4bdf56a9189f6b3f7512886cbfb)
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst | 70 |
1 files changed, 64 insertions, 6 deletions
diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst index 1069604438..6be8dbbf63 100644 --- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst +++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst | |||
| @@ -538,11 +538,28 @@ overview of their function and contents. | |||
| 538 | version 4.20 expose under ``/proc/pressure``. The threshold represents | 538 | version 4.20 expose under ``/proc/pressure``. The threshold represents |
| 539 | the difference in "total" pressure from the previous second. The | 539 | the difference in "total" pressure from the previous second. The |
| 540 | minimum value is 1.0 (extremely slow builds) and the maximum is | 540 | minimum value is 1.0 (extremely slow builds) and the maximum is |
| 541 | 1000000 (a pressure value unlikely to ever be reached). | 541 | 1000000 (a pressure value unlikely to ever be reached). See |
| 542 | https://docs.kernel.org/accounting/psi.html for more information. | ||
| 542 | 543 | ||
| 543 | This threshold can be set in ``conf/local.conf`` as:: | 544 | A default value to limit the CPU pressure to be set in ``conf/local.conf`` |
| 545 | could be:: | ||
| 544 | 546 | ||
| 545 | BB_PRESSURE_MAX_CPU = "500" | 547 | BB_PRESSURE_MAX_CPU = "15000" |
| 548 | |||
| 549 | Multiple values should be tested on the build host to determine what suits | ||
| 550 | best, depending on the need for performances versus load average during | ||
| 551 | the build. | ||
| 552 | |||
| 553 | .. note:: | ||
| 554 | |||
| 555 | You may see numerous messages printed by BitBake in the case the | ||
| 556 | :term:`BB_PRESSURE_MAX_CPU` is too low: | ||
| 557 | |||
| 558 | 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 | ||
| 559 | |||
| 560 | This means that the :term:`BB_PRESSURE_MAX_CPU` should be increased to | ||
| 561 | a reasonable value for limiting the CPU pressure on the system. | ||
| 562 | Monitor the varying value after ``IO:`` above to set a sensible value. | ||
| 546 | 563 | ||
| 547 | :term:`BB_PRESSURE_MAX_IO` | 564 | :term:`BB_PRESSURE_MAX_IO` |
| 548 | Specifies a maximum I/O pressure threshold, above which BitBake's | 565 | Specifies a maximum I/O pressure threshold, above which BitBake's |
| @@ -554,14 +571,34 @@ overview of their function and contents. | |||
| 554 | version 4.20 expose under ``/proc/pressure``. The threshold represents | 571 | version 4.20 expose under ``/proc/pressure``. The threshold represents |
| 555 | the difference in "total" pressure from the previous second. The | 572 | the difference in "total" pressure from the previous second. The |
| 556 | minimum value is 1.0 (extremely slow builds) and the maximum is | 573 | minimum value is 1.0 (extremely slow builds) and the maximum is |
| 557 | 1000000 (a pressure value unlikely to ever be reached). | 574 | 1000000 (a pressure value unlikely to ever be reached). See |
| 575 | https://docs.kernel.org/accounting/psi.html for more information. | ||
| 558 | 576 | ||
| 559 | At this point in time, experiments show that IO pressure tends to | 577 | At this point in time, experiments show that IO pressure tends to |
| 560 | be short-lived and regulating just the CPU with | 578 | be short-lived and regulating just the CPU with |
| 561 | :term:`BB_PRESSURE_MAX_CPU` can help to reduce it. | 579 | :term:`BB_PRESSURE_MAX_CPU` can help to reduce it. |
| 562 | 580 | ||
| 563 | :term:`BB_PRESSURE_MAX_MEMORY` | 581 | A default value to limit the IO pressure to be set in ``conf/local.conf`` |
| 582 | could be:: | ||
| 583 | |||
| 584 | BB_PRESSURE_MAX_IO = "15000" | ||
| 585 | |||
| 586 | Multiple values should be tested on the build host to determine what suits | ||
| 587 | best, depending on the need for performances versus I/O usage during the | ||
| 588 | build. | ||
| 589 | |||
| 590 | .. note:: | ||
| 591 | |||
| 592 | You may see numerous messages printed by BitBake in the case the | ||
| 593 | :term:`BB_PRESSURE_MAX_IO` is too low:: | ||
| 564 | 594 | ||
| 595 | 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 | ||
| 596 | |||
| 597 | This means that the :term:`BB_PRESSURE_MAX_IO` should be increased to | ||
| 598 | a reasonable value for limiting the I/O pressure on the system. | ||
| 599 | Monitor the varying value after ``IO:`` above to set a sensible value. | ||
| 600 | |||
| 601 | :term:`BB_PRESSURE_MAX_MEMORY` | ||
| 565 | Specifies a maximum memory pressure threshold, above which BitBake's | 602 | Specifies a maximum memory pressure threshold, above which BitBake's |
| 566 | scheduler will not start new tasks (providing there is at least | 603 | scheduler will not start new tasks (providing there is at least |
| 567 | one active task). If no value is set, memory pressure is not | 604 | one active task). If no value is set, memory pressure is not |
| @@ -571,7 +608,8 @@ overview of their function and contents. | |||
| 571 | version 4.20 expose under ``/proc/pressure``. The threshold represents | 608 | version 4.20 expose under ``/proc/pressure``. The threshold represents |
| 572 | the difference in "total" pressure from the previous second. The | 609 | the difference in "total" pressure from the previous second. The |
| 573 | minimum value is 1.0 (extremely slow builds) and the maximum is | 610 | minimum value is 1.0 (extremely slow builds) and the maximum is |
| 574 | 1000000 (a pressure value unlikely to ever be reached). | 611 | 1000000 (a pressure value unlikely to ever be reached). See |
| 612 | https://docs.kernel.org/accounting/psi.html for more information. | ||
| 575 | 613 | ||
| 576 | Memory pressure is experienced when time is spent swapping, | 614 | Memory pressure is experienced when time is spent swapping, |
| 577 | refaulting pages from the page cache or performing direct reclaim. | 615 | refaulting pages from the page cache or performing direct reclaim. |
| @@ -579,6 +617,26 @@ overview of their function and contents. | |||
| 579 | might be useful as a last resort to prevent OOM errors if they are | 617 | might be useful as a last resort to prevent OOM errors if they are |
| 580 | occurring during builds. | 618 | occurring during builds. |
| 581 | 619 | ||
| 620 | A default value to limit the memory pressure to be set in | ||
| 621 | ``conf/local.conf`` could be:: | ||
| 622 | |||
| 623 | BB_PRESSURE_MAX_MEMORY = "15000" | ||
| 624 | |||
| 625 | Multiple values should be tested on the build host to determine what suits | ||
| 626 | best, depending on the need for performances versus memory consumption | ||
| 627 | during the build. | ||
| 628 | |||
| 629 | .. note:: | ||
| 630 | |||
| 631 | You may see numerous messages printed by BitBake in the case the | ||
| 632 | :term:`BB_PRESSURE_MAX_MEMORY` is too low:: | ||
| 633 | |||
| 634 | 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 | ||
| 635 | |||
| 636 | This means that the :term:`BB_PRESSURE_MAX_MEMORY` should be increased to | ||
| 637 | a reasonable value for limiting the memory pressure on the system. | ||
| 638 | Monitor the varying value after ``Mem:`` above to set a sensible value. | ||
| 639 | |||
| 582 | :term:`BB_RUNFMT` | 640 | :term:`BB_RUNFMT` |
| 583 | Specifies the name of the executable script files (i.e. run files) | 641 | Specifies the name of the executable script files (i.e. run files) |
| 584 | saved into ``${``\ :term:`T`\ ``}``. By default, the | 642 | saved into ``${``\ :term:`T`\ ``}``. By default, the |
