From 99a1cac632b4325afb95cb7c183721c0a90925d7 Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Thu, 19 Feb 2009 05:21:47 -0800 Subject: Reduce iothreads requests queue lock granularity. iot_queue() and iot_dequeue() functions were using a io-threads translator-wide lock which would be contended for by every worker thread waiting for IO requests. This patch reduces the granularity by turning the lock into a per-worker lock. Signed-off-by: Anand V. Avati --- xlators/performance/io-threads/src/io-threads.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xlators/performance/io-threads/src/io-threads.h') diff --git a/xlators/performance/io-threads/src/io-threads.h b/xlators/performance/io-threads/src/io-threads.h index 419f6fdb8e6..401d0d86dc9 100644 --- a/xlators/performance/io-threads/src/io-threads.h +++ b/xlators/performance/io-threads/src/io-threads.h @@ -58,6 +58,7 @@ struct iot_worker { struct iot_conf *conf; int64_t q,dq; pthread_cond_t dq_cond; + pthread_mutex_t qlock; int32_t fd_count; int32_t queue_size; pthread_t thread; @@ -78,7 +79,6 @@ struct iot_conf { pthread_mutex_t files_lock; pthread_cond_t q_cond; - pthread_mutex_t lock; }; typedef struct iot_file iot_file_t; -- cgit