[PATCH 4/4] worker: don't do too much polling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Now that processing is correctly restored there is no need to keep
polling to avoid main loop hangs. Reduce the polling count to 1
(just try once).
This reduce cpu usage if guests are mainly idle.
If you consider 100 guests waiting to login with cursor blinking
and considering the polling was done 200 times every 10ms (maximum)
just the cursor blinking was causing 10100 loop iterations per second
while now only 200 are needed (considering cursor blinking every
second).

Signed-by: Frediano Ziglio <figlio@xxxxxxxxxx>
---
 server/red-worker.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/red-worker.c b/server/red-worker.c
index 8c79628..33c5105 100644
--- a/server/red-worker.c
+++ b/server/red-worker.c
@@ -53,7 +53,7 @@
 #include "tree.h"
 
 #define CMD_RING_POLL_TIMEOUT 10 //milli
-#define CMD_RING_POLL_RETRIES 200
+#define CMD_RING_POLL_RETRIES 1
 
 #define INF_EVENT_WAIT ~0
 
-- 
2.4.3

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]