From 57957c59cd2925540769ae9cb58029b0125e4ae7 Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Thu, 19 Feb 2009 05:20:41 -0800 Subject: Remove conf->cache_size checks Since we're not dependent on this io-thread internal state(i.e. cache_size and current_size) to rate limit requests, we can remove these two data members and code that checks for these. Signed-off-by: Anand V. Avati --- xlators/performance/io-threads/src/io-threads.c | 14 -------------- xlators/performance/io-threads/src/io-threads.h | 2 -- 2 files changed, 16 deletions(-) diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c index 27140a39821..346e1234bb9 100644 --- a/xlators/performance/io-threads/src/io-threads.c +++ b/xlators/performance/io-threads/src/io-threads.c @@ -1022,8 +1022,6 @@ iot_queue (iot_worker_t *worker, { iot_queue_t *queue; iot_conf_t *conf = worker->conf; - iot_local_t *local = stub->frame->local; - size_t frame_size = local->frame_size; queue = CALLOC (1, sizeof (*queue)); ERR_ABORT (queue); @@ -1031,11 +1029,6 @@ iot_queue (iot_worker_t *worker, pthread_mutex_lock (&conf->lock); - if (conf->cache_size) { - while (frame_size && (conf->current_size >= conf->cache_size)) - pthread_cond_wait (&conf->q_cond, &conf->lock); - } - queue->next = &worker->queue; queue->prev = worker->queue.prev; @@ -1046,8 +1039,6 @@ iot_queue (iot_worker_t *worker, worker->queue_size++; worker->q++; - conf->current_size += local->frame_size; - pthread_cond_broadcast (&worker->dq_cond); pthread_mutex_unlock (&conf->lock); @@ -1059,7 +1050,6 @@ iot_dequeue (iot_worker_t *worker) call_stub_t *stub = NULL; iot_queue_t *queue = NULL; iot_conf_t *conf = worker->conf; - iot_local_t *local = NULL; pthread_mutex_lock (&conf->lock); @@ -1073,14 +1063,10 @@ iot_dequeue (iot_worker_t *worker) queue->prev->next = queue->next; stub = queue->stub; - local = stub->frame->local; worker->queue_size--; worker->dq++; - /* q_cond */ - conf->current_size -= local->frame_size; - pthread_cond_broadcast (&conf->q_cond); pthread_mutex_unlock (&conf->lock); diff --git a/xlators/performance/io-threads/src/io-threads.h b/xlators/performance/io-threads/src/io-threads.h index db578115750..419f6fdb8e6 100644 --- a/xlators/performance/io-threads/src/io-threads.h +++ b/xlators/performance/io-threads/src/io-threads.h @@ -77,8 +77,6 @@ struct iot_conf { struct iot_file files; pthread_mutex_t files_lock; - uint64_t cache_size; - off_t current_size; pthread_cond_t q_cond; pthread_mutex_t lock; }; -- cgit