diff options
author | Max Rijevski <moox@fb.com> | 2016-04-07 13:11:20 -0700 |
---|---|---|
committer | Jeff Darcy <jeff@pl.atyp.us> | 2017-12-07 02:41:24 +0000 |
commit | b5184d6e75b884f98c8aea37d1604f0a244b31cc (patch) | |
tree | e9e85f39a791d90b68c520e51cf77ef839af7d99 /xlators | |
parent | 4eb49de567c5e9f4559bfb05a6174ac8020b03ad (diff) |
performance/io-threads: Reduce the number of timing calls in iot_worker
Summary:
- Reduce the amount of unnecessary timing calls
in iot_worker servicing.
- The current logic is unnecessarily accurate and
hurts performance for many small FOPS.
Change-Id: I6db4f1ad9a48d9d474bb251a2204969061021954
BUG: 1522950
Signed-off-by: Shreyas Siravara <sshreyas@fb.com>
Reviewed-on: http://review.gluster.org/16081
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Kevin Vigor <kvigor@fb.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/performance/io-threads/src/io-threads.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c index 7aafc8accf5..7fc153dddeb 100644 --- a/xlators/performance/io-threads/src/io-threads.c +++ b/xlators/performance/io-threads/src/io-threads.c @@ -174,8 +174,6 @@ iot_worker (void *data) THIS = this; for (;;) { - sleep_till.tv_sec = time (NULL) + conf->idle_time; - pthread_mutex_lock (&conf->mutex); { if (pri != -1) { @@ -188,8 +186,11 @@ iot_worker (void *data) break; } - conf->sleep_count++; + clock_gettime (CLOCK_REALTIME_COARSE, + &sleep_till); + sleep_till.tv_sec += conf->idle_time; + conf->sleep_count++; ret = pthread_cond_timedwait (&conf->cond, &conf->mutex, &sleep_till); |