All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core <openembedded-core@lists.openembedded.org>
Subject: [PATCH] lib/oeqa/qemurunner: Use a timeout in select() call
Date: Fri, 06 Sep 2013 15:42:59 +0100	[thread overview]
Message-ID: <1378478579.3484.4.camel@ted> (raw)

A 0 value to select.select() immediately returns with no timeout. This was
pegging the cpu at 100% for the python process which was bad and may be
contributing to some of the timeout problems.

Profile from -P of a core-image-minimal before:

    97526792 function calls (97525652 primitive calls) in 45.189 seconds

and after:

       50204 function calls (49064 primitive calls) in 17.318 seconds

Saving 97.5 million function calls has to be good :)

(From OE-Core rev: a572348c7ec1eb82fa2e5c977b27c24b4a9b29a1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index e7bd8b1..f837800 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -101,7 +101,7 @@ class QemuRunner:
             reachedlogin = False
             stopread = False
             while time.time() < endtime and not stopread:
-                sread, swrite, serror = select.select(socklist, [], [], 0)
+                sread, swrite, serror = select.select(socklist, [], [], 0.1)
                 for sock in sread:
                     if sock is self.server_socket:
                         self.qemusock, addr = self.server_socket.accept()




             reply	other threads:[~2013-09-06 14:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-06 14:42 Richard Purdie [this message]
2013-09-06 14:46 ` [PATCH] lib/oeqa/qemurunner: Use a timeout in select() call Burton, Ross
2013-09-06 14:50   ` Richard Purdie
2013-09-06 17:57     ` Burton, Ross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1378478579.3484.4.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.