diff options
| author | Max Rijevski <moox@fb.com> | 2016-04-07 13:11:20 -0700 |
|---|---|---|
| committer | Shreyas Siravara <sshreyas@fb.com> | 2016-12-09 09:10:15 -0800 |
| commit | 87f9dc9e709b16080d090c990f49c1bdafb64fce (patch) | |
| tree | 7f394b7c9d1d83bacb79cd6f460e2f2d8b3ac52e /xlators/performance | |
| parent | 17cce29c4da1d086aaaba852971b76fe4488b360 (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.
- This is a cherry-pick of D3156588 for 3.8
Test Plan:
- Prove tests
Change-Id: I6db4f1ad9a48d9d474bb251a2204969061021954
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/performance')
| -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 541079e2070..5ab38890df3 100644 --- a/xlators/performance/io-threads/src/io-threads.c +++ b/xlators/performance/io-threads/src/io-threads.c @@ -162,8 +162,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) { @@ -171,8 +169,11 @@ iot_worker (void *data) pri = -1; } while (conf->queue_size == 0) { - 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); |
