* [PATCH] lib/oeqa/qemurunner: Use a timeout in select() call
@ 2013-09-06 14:42 Richard Purdie
2013-09-06 14:46 ` Burton, Ross
0 siblings, 1 reply; 4+ messages in thread
From: Richard Purdie @ 2013-09-06 14:42 UTC (permalink / raw)
To: openembedded-core
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()
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] lib/oeqa/qemurunner: Use a timeout in select() call
2013-09-06 14:42 [PATCH] lib/oeqa/qemurunner: Use a timeout in select() call Richard Purdie
@ 2013-09-06 14:46 ` Burton, Ross
2013-09-06 14:50 ` Richard Purdie
0 siblings, 1 reply; 4+ messages in thread
From: Burton, Ross @ 2013-09-06 14:46 UTC (permalink / raw)
To: Richard Purdie; +Cc: openembedded-core
On 6 September 2013 15:42, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> - sread, swrite, serror = select.select(socklist, [], [], 0)
> + sread, swrite, serror = select.select(socklist, [], [], 0.1)
As discussed on IM, for the purposes of this loop a timeout of seconds
instead of fractions of seconds would be more correct, although we're
obviously going to be having diminishing returns.
Ross
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] lib/oeqa/qemurunner: Use a timeout in select() call
2013-09-06 14:46 ` Burton, Ross
@ 2013-09-06 14:50 ` Richard Purdie
2013-09-06 17:57 ` Burton, Ross
0 siblings, 1 reply; 4+ messages in thread
From: Richard Purdie @ 2013-09-06 14:50 UTC (permalink / raw)
To: Burton, Ross; +Cc: openembedded-core
On Fri, 2013-09-06 at 15:46 +0100, Burton, Ross wrote:
> On 6 September 2013 15:42, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > - sread, swrite, serror = select.select(socklist, [], [], 0)
> > + sread, swrite, serror = select.select(socklist, [], [], 0.1)
>
> As discussed on IM, for the purposes of this loop a timeout of seconds
> instead of fractions of seconds would be more correct, although we're
> obviously going to be having diminishing returns.
Basically, agreed. I've pushed this into master-next for testing
purposes whilst we discuss what this really should be. I think 5 might
be a good number.
Cheers,
Richard
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] lib/oeqa/qemurunner: Use a timeout in select() call
2013-09-06 14:50 ` Richard Purdie
@ 2013-09-06 17:57 ` Burton, Ross
0 siblings, 0 replies; 4+ messages in thread
From: Burton, Ross @ 2013-09-06 17:57 UTC (permalink / raw)
To: Richard Purdie; +Cc: openembedded-core
On 6 September 2013 15:50, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> Basically, agreed. I've pushed this into master-next for testing
> purposes whilst we discuss what this really should be. I think 5 might
> be a good number.
That certainly seems like a compromise between needless spinning and a
noticeable delta between requested and actual overall timeout.
Ross
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-09-06 17:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-06 14:42 [PATCH] lib/oeqa/qemurunner: Use a timeout in select() call Richard Purdie
2013-09-06 14:46 ` Burton, Ross
2013-09-06 14:50 ` Richard Purdie
2013-09-06 17:57 ` Burton, Ross
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox