From: Peter Dinda Date: Thu, 10 Oct 2013 20:27:12 +0000 (-0500) Subject: Switch VNET to use adaptive yielding by default, to reduce busy-waiting in the bridge... X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=118812a7a69c964dc50022f2e30cc04643d81c0f Switch VNET to use adaptive yielding by default, to reduce busy-waiting in the bridge and transmit-kick threads --- diff --git a/linux_module/palacios-vnet-brg.c b/linux_module/palacios-vnet-brg.c index 1dfe8a8..829c069 100644 --- a/linux_module/palacios-vnet-brg.c +++ b/linux_module/palacios-vnet-brg.c @@ -32,7 +32,7 @@ #define VNET_SERVER_PORT 9000 -#define VNET_ADAPTIVE_BRIDGE 0 // set this to one to have bridge go to sleep if there nothing to do... +#define VNET_ADAPTIVE_BRIDGE 1 // set this to one to have bridge go to sleep if there nothing to do... #define VNET_NOPROGRESS_LIMIT 1000 // ... after this many iterations #define VNET_YIELD_TIME_USEC 1000 // ... and go to sleep for this long @@ -479,7 +479,7 @@ static int _udp_server(void * arg) { } else { // Likely not making progress, do potentially slow // yield - we won't come back for until VNET_YIELD_TIME_USEC has passed - palacios_yield_cpu_timed(VNET_YIELD_TIME_USEC); + palacios_sleep_cpu(VNET_YIELD_TIME_USEC); } continue; diff --git a/palacios/src/vnet/vnet_core.c b/palacios/src/vnet/vnet_core.c index 7d9942d..70ba382 100644 --- a/palacios/src/vnet/vnet_core.c +++ b/palacios/src/vnet/vnet_core.c @@ -33,7 +33,7 @@ #define VNET_NUM_TX_KICK_THREADS 1 -#define VNET_ADAPTIVE_TX_KICK 0 // set to 1 to try to sleep when there is nothing to do +#define VNET_ADAPTIVE_TX_KICK 1 // set to 1 to try to sleep when there is nothing to do #define VNET_NOPROGRESS_LIMIT 1000 // ... after this many tries #define VNET_YIELD_USEC 1000 // ... and go to sleep for this long