runtime: zero queueing delay when runningks is less than max
@@ -20,6 +20,10 @@ extern int runtime_init(const char *cfgpath, thread_fn_t main_fn, void *arg);
extern struct congestion_info *runtime_congestion;
+extern unsigned int maxks;
+extern unsigned int guaranteedks;
+extern atomic_t runningks;
+
/**
* runtime_standing_queue_us - returns the us a queue has been left standing
*/
@@ -40,6 +44,9 @@ static inline uint64_t runtime_queue_us(void)
uint64_t rq_delay = 0;
uint64_t pkq_delay = 0;
+ if ((unsigned int)atomic_read(&runningks) < maxks)
+ return 0;
+
if (now > rq_oldest_tsc)
rq_delay = now - rq_oldest_tsc;
@@ -57,11 +64,6 @@ static inline float runtime_load(void)
return ACCESS_ONCE(runtime_congestion->load);
}
-extern unsigned int maxks;
-extern unsigned int guaranteedks;
-extern atomic_t runningks;
-
-
/**
* runtime_active_cores - returns the number of currently active cores
*
