All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] server/process: Don't send heartbeats when no idle functions
@ 2024-11-05 15:06 Richard Purdie
  2024-11-05 15:06 ` [PATCH 2/2] server/process: Decrease idle/main loop frequency Richard Purdie
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Purdie @ 2024-11-05 15:06 UTC (permalink / raw)
  To: bitbake-devel

If there are no idle functions present, don't sent heartbeat events. These
are only meant to happen while builds are active.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 lib/bb/server/process.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py
index ad4035a738..b627ae0ab6 100644
--- a/lib/bb/server/process.py
+++ b/lib/bb/server/process.py
@@ -477,7 +477,7 @@ class ProcessServer():
 
             # Create new heartbeat event?
             now = time.time()
-            if bb.event._heartbeat_enabled and now >= self.next_heartbeat:
+            if items and bb.event._heartbeat_enabled and now >= self.next_heartbeat:
                 # We might have missed heartbeats. Just trigger once in
                 # that case and continue after the usual delay.
                 self.next_heartbeat += self.heartbeat_seconds


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

* [PATCH 2/2] server/process: Decrease idle/main loop frequency
  2024-11-05 15:06 [PATCH 1/2] server/process: Don't send heartbeats when no idle functions Richard Purdie
@ 2024-11-05 15:06 ` Richard Purdie
  2024-11-05 16:40   ` [bitbake-devel] " Mathieu Dubois-Briand
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Purdie @ 2024-11-05 15:06 UTC (permalink / raw)
  To: bitbake-devel

The idle and main loops have socket select calls to know when to execute.
This means we can increase the normal timeout frequency since this is
just a fall back and have some small efficiency gains.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 lib/bb/server/process.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py
index b627ae0ab6..4b35be62cd 100644
--- a/lib/bb/server/process.py
+++ b/lib/bb/server/process.py
@@ -329,7 +329,7 @@ class ProcessServer():
                 bb.error("Idle thread terminated, main thread exiting too")
                 self.quit = True
 
-            nextsleep = 0.1
+            nextsleep = 1.0
             if self.xmlrpc:
                 nextsleep = self.xmlrpc.get_timeout(nextsleep)
             try:
@@ -439,7 +439,7 @@ class ProcessServer():
                 self.idle_cond.notify_all()
 
         while not self.quit:
-            nextsleep = 0.1
+            nextsleep = 1.0
             fds = []
 
             with bb.utils.lock_timeout(self._idlefuncsLock):


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

* Re: [bitbake-devel] [PATCH 2/2] server/process: Decrease idle/main loop frequency
  2024-11-05 15:06 ` [PATCH 2/2] server/process: Decrease idle/main loop frequency Richard Purdie
@ 2024-11-05 16:40   ` Mathieu Dubois-Briand
  2024-11-05 22:29     ` Richard Purdie
  0 siblings, 1 reply; 4+ messages in thread
From: Mathieu Dubois-Briand @ 2024-11-05 16:40 UTC (permalink / raw)
  To: Richard Purdie; +Cc: bitbake-devel

On Tue, Nov 05, 2024 at 03:06:28PM +0000, Richard Purdie wrote:
> The idle and main loops have socket select calls to know when to execute.
> This means we can increase the normal timeout frequency since this is
> just a fall back and have some small efficiency gains.
> 
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

Hi Richard,

This patch set does not apply cleanly on master nor on my master-next. I
believe it misses the "Merge a function to simplfy code" from your
master-next branch.

-- 
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


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

* Re: [bitbake-devel] [PATCH 2/2] server/process: Decrease idle/main loop frequency
  2024-11-05 16:40   ` [bitbake-devel] " Mathieu Dubois-Briand
@ 2024-11-05 22:29     ` Richard Purdie
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Purdie @ 2024-11-05 22:29 UTC (permalink / raw)
  To: bitbake-devel

On Tue, 2024-11-05 at 17:40 +0100, Mathieu Dubois-Briand wrote:
> On Tue, Nov 05, 2024 at 03:06:28PM +0000, Richard Purdie wrote:
> > The idle and main loops have socket select calls to know when to
> > execute.
> > This means we can increase the normal timeout frequency since this
> > is
> > just a fall back and have some small efficiency gains.
> > 
> > Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> 
> Hi Richard,
> 
> This patch set does not apply cleanly on master nor on my master-
> next. I
> believe it misses the "Merge a function to simplfy code" from your
> master-next branch.

Sorry, I've sent that one as well. I need to stop missing a single
patch like this!

Cheers,

Richard


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

end of thread, other threads:[~2024-11-05 22:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-05 15:06 [PATCH 1/2] server/process: Don't send heartbeats when no idle functions Richard Purdie
2024-11-05 15:06 ` [PATCH 2/2] server/process: Decrease idle/main loop frequency Richard Purdie
2024-11-05 16:40   ` [bitbake-devel] " Mathieu Dubois-Briand
2024-11-05 22:29     ` 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.