All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] runqueue: Allow pressure state change notifications to be disabled
@ 2025-05-23 14:52 Mike Crowe
  2025-05-27  8:11 ` [bitbake-devel] " Richard Purdie
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Crowe @ 2025-05-23 14:52 UTC (permalink / raw)
  To: bitbake-devel; +Cc: Mike Crowe, Jack Mitchell

Allow setting BB_PRESSURE_NOTE_CHANGE = "0" to disable NOTE messages
being emitted every time the pressure state changes. The previous
default behaviour is not changed.

Signed-off-by: Mike Crowe <mac@mcrowe.com>
Reviewed-by: Jack Mitchell <jack@embed.me.uk>
---
 .../bitbake-user-manual-ref-variables.rst                  | 7 +++++++
 lib/bb/runqueue.py                                         | 3 ++-
 2 files changed, 9 insertions(+), 1 deletion(-)

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 477443e22..cd81a586e 100644
--- a/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
+++ b/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
@@ -574,6 +574,13 @@ overview of their function and contents.
       might be useful as a last resort to prevent OOM errors if they are
       occurring during builds.
 
+   :term:`BB_PRESSURE_NOTE_CHANGE`
+
+      By default Bitbake emits a note message each time the scheduler
+      decides to stop or start scheduling new tasks due to pressure
+      changes. Setting :term:`BB_PRESSURE_NOTE_CHANGE` to "0" stops these
+      messages.
+
    :term:`BB_RUNFMT`
       Specifies the name of the executable script files (i.e. run files)
       saved into ``${``\ :term:`T`\ ``}``. By default, the
diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index 8fadc8338..306814fd6 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -218,7 +218,7 @@ class RunQueueScheduler(object):
 
             pressure_state = (exceeds_cpu_pressure, exceeds_io_pressure, exceeds_memory_pressure)
             pressure_values = (round(cpu_pressure,1), self.rq.max_cpu_pressure, round(io_pressure,1), self.rq.max_io_pressure, round(memory_pressure,1), self.rq.max_memory_pressure)
-            if hasattr(self, "pressure_state") and pressure_state != self.pressure_state:
+            if self.rq.note_pressure_state_change and hasattr(self, "pressure_state") and pressure_state != self.pressure_state:
                 bb.note("Pressure status changed to CPU: %s, IO: %s, Mem: %s (CPU: %s/%s, IO: %s/%s, Mem: %s/%s) - using %s/%s bitbake threads" % (pressure_state + pressure_values + (len(self.rq.runq_running.difference(self.rq.runq_complete)), self.rq.number_tasks)))
             self.pressure_state = pressure_state
             return (exceeds_cpu_pressure or exceeds_io_pressure or exceeds_memory_pressure)
@@ -1864,6 +1864,7 @@ class RunQueueExecute:
         self.max_io_pressure = self.cfgData.getVar("BB_PRESSURE_MAX_IO")
         self.max_memory_pressure = self.cfgData.getVar("BB_PRESSURE_MAX_MEMORY")
         self.max_loadfactor = self.cfgData.getVar("BB_LOADFACTOR_MAX")
+        self.note_pressure_state_change = (self.cfgData.getVar("BB_PRESSURE_NOTE_CHANGE") or "1") != "0"
 
         self.sq_buildable = set()
         self.sq_running = set()
-- 
2.39.5



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-05-28 12:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-23 14:52 [PATCH] runqueue: Allow pressure state change notifications to be disabled Mike Crowe
2025-05-27  8:11 ` [bitbake-devel] " Richard Purdie
2025-05-27 15:23   ` Mike Crowe
2025-05-27 16:07     ` Richard Purdie
2025-05-28 12:22       ` Tuning BB_PRESSURE_ values (was Re: [bitbake-devel] [PATCH] runqueue: Allow pressure state change notifications to be disabled) Mike Crowe
2025-05-28 12:34         ` Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.