[stgt] [PATCH 2/2] use FIFO policy instead FILO for I/O thread request handling

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Wed Sep 9 12:44:53 CEST 2009


Somehow, I/O threads perform requests in FILO manner. We should use
FIFO for better performance.

Signed-off-by: FUJITA Tomonori <fujita.tomonori at lab.ntt.co.jp>
---
 usr/bs.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/usr/bs.c b/usr/bs.c
index df0aab8..e7cfb05 100644
--- a/usr/bs.c
+++ b/usr/bs.c
@@ -98,7 +98,7 @@ retest:
 		dprintf("found %p\n", cmd);
 
 		list_del(&cmd->bs_list);
-		list_add(&cmd->bs_list, &info->ack_list);
+		list_add_tail(&cmd->bs_list, &info->ack_list);
 	}
 
 	pthread_mutex_unlock(&info->finished_lock);
@@ -214,7 +214,7 @@ static void *bs_thread_worker_fn(void *arg)
 
 		if (sig_fd < 0) {
 			pthread_mutex_lock(&info->finished_lock);
-			list_add(&cmd->bs_list, &info->finished_list);
+			list_add_tail(&cmd->bs_list, &info->finished_list);
 			pthread_mutex_unlock(&info->finished_lock);
 
 			pthread_cond_signal(&info->finished_cond);
@@ -402,7 +402,7 @@ int bs_thread_cmd_submit(struct scsi_cmd *cmd)
 
 	pthread_mutex_lock(&info->pending_lock);
 
-	list_add(&cmd->bs_list, &info->pending_list);
+	list_add_tail(&cmd->bs_list, &info->pending_list);
 
 	pthread_mutex_unlock(&info->pending_lock);
 
-- 
1.6.0.6

--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list