aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorJens Axboe <jaxboe@fusionio.com>2011-01-10 15:50:33 -0500
committerJens Axboe <jaxboe@fusionio.com>2011-01-10 15:50:33 -0500
commite6e1ee936d61d697735d17517678a626b7701ce4 (patch)
tree1cb8d45e69a1dadbf0dc0e8bb1b944a4ab86629c /drivers/block
parent2b51dca79a105dea022776ea7874193239df7fbd (diff)
cciss: reinstate proper FIFO order of command queue list
Commit 8a3173de inadvertently changed the ordering when switching to hlists. Change to regular list heads so we can use tail list adds, this improves performance. Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/cciss.c23
-rw-r--r--drivers/block/cciss.h4
-rw-r--r--drivers/block/cciss_cmd.h2
3 files changed, 14 insertions, 15 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 5e4fadcdece9..a54f7f4b91f6 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -266,9 +266,9 @@ static void set_performant_mode(ctlr_info_t *h, CommandList_struct *c)
266/* 266/*
267 * Enqueuing and dequeuing functions for cmdlists. 267 * Enqueuing and dequeuing functions for cmdlists.
268 */ 268 */
269static inline void addQ(struct hlist_head *list, CommandList_struct *c) 269static inline void addQ(struct list_head *list, CommandList_struct *c)
270{ 270{
271 hlist_add_head(&c->list, list); 271 list_add_tail(&c->list, list);
272} 272}
273 273
274static inline void removeQ(CommandList_struct *c) 274static inline void removeQ(CommandList_struct *c)
@@ -281,12 +281,12 @@ static inline void removeQ(CommandList_struct *c)
281 * them off as 'stale' to prevent the driver from 281 * them off as 'stale' to prevent the driver from
282 * falling over. 282 * falling over.
283 */ 283 */
284 if (WARN_ON(hlist_unhashed(&c->list))) { 284 if (WARN_ON(list_empty(&c->list))) {
285 c->cmd_type = CMD_MSG_STALE; 285 c->cmd_type = CMD_MSG_STALE;
286 return; 286 return;
287 } 287 }
288 288
289 hlist_del_init(&c->list); 289 list_del_init(&c->list);
290} 290}
291 291
292static void enqueue_cmd_and_start_io(ctlr_info_t *h, 292static void enqueue_cmd_and_start_io(ctlr_info_t *h,
@@ -935,7 +935,7 @@ static CommandList_struct *cmd_alloc(ctlr_info_t *h)
935 935
936 c->cmdindex = i; 936 c->cmdindex = i;
937 937
938 INIT_HLIST_NODE(&c->list); 938 INIT_LIST_HEAD(&c->list);
939 c->busaddr = (__u32) cmd_dma_handle; 939 c->busaddr = (__u32) cmd_dma_handle;
940 temp64.val = (__u64) err_dma_handle; 940 temp64.val = (__u64) err_dma_handle;
941 c->ErrDesc.Addr.lower = temp64.val32.lower; 941 c->ErrDesc.Addr.lower = temp64.val32.lower;
@@ -974,7 +974,7 @@ static CommandList_struct *cmd_special_alloc(ctlr_info_t *h)
974 } 974 }
975 memset(c->err_info, 0, sizeof(ErrorInfo_struct)); 975 memset(c->err_info, 0, sizeof(ErrorInfo_struct));
976 976
977 INIT_HLIST_NODE(&c->list); 977 INIT_LIST_HEAD(&c->list);
978 c->busaddr = (__u32) cmd_dma_handle; 978 c->busaddr = (__u32) cmd_dma_handle;
979 temp64.val = (__u64) err_dma_handle; 979 temp64.val = (__u64) err_dma_handle;
980 c->ErrDesc.Addr.lower = temp64.val32.lower; 980 c->ErrDesc.Addr.lower = temp64.val32.lower;
@@ -2933,8 +2933,8 @@ static void start_io(ctlr_info_t *h)
2933{ 2933{
2934 CommandList_struct *c; 2934 CommandList_struct *c;
2935 2935
2936 while (!hlist_empty(&h->reqQ)) { 2936 while (!list_empty(&h->reqQ)) {
2937 c = hlist_entry(h->reqQ.first, CommandList_struct, list); 2937 c = list_entry(h->reqQ.next, CommandList_struct, list);
2938 /* can't do anything if fifo is full */ 2938 /* can't do anything if fifo is full */
2939 if ((h->access.fifo_full(h))) { 2939 if ((h->access.fifo_full(h))) {
2940 dev_warn(&h->pdev->dev, "fifo full\n"); 2940 dev_warn(&h->pdev->dev, "fifo full\n");
@@ -3447,11 +3447,10 @@ static inline u32 process_nonindexed_cmd(ctlr_info_t *h, u32 raw_tag)
3447{ 3447{
3448 u32 tag; 3448 u32 tag;
3449 CommandList_struct *c = NULL; 3449 CommandList_struct *c = NULL;
3450 struct hlist_node *tmp;
3451 __u32 busaddr_masked, tag_masked; 3450 __u32 busaddr_masked, tag_masked;
3452 3451
3453 tag = cciss_tag_discard_error_bits(raw_tag); 3452 tag = cciss_tag_discard_error_bits(raw_tag);
3454 hlist_for_each_entry(c, tmp, &h->cmpQ, list) { 3453 list_for_each_entry(c, &h->cmpQ, list) {
3455 busaddr_masked = cciss_tag_discard_error_bits(c->busaddr); 3454 busaddr_masked = cciss_tag_discard_error_bits(c->busaddr);
3456 tag_masked = cciss_tag_discard_error_bits(tag); 3455 tag_masked = cciss_tag_discard_error_bits(tag);
3457 if (busaddr_masked == tag_masked) { 3456 if (busaddr_masked == tag_masked) {
@@ -4632,8 +4631,8 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
4632 h = hba[i]; 4631 h = hba[i];
4633 h->pdev = pdev; 4632 h->pdev = pdev;
4634 h->busy_initializing = 1; 4633 h->busy_initializing = 1;
4635 INIT_HLIST_HEAD(&h->cmpQ); 4634 INIT_LIST_HEAD(&h->cmpQ);
4636 INIT_HLIST_HEAD(&h->reqQ); 4635 INIT_LIST_HEAD(&h->reqQ);
4637 mutex_init(&h->busy_shutting_down); 4636 mutex_init(&h->busy_shutting_down);
4638 4637
4639 if (cciss_pci_init(h) != 0) 4638 if (cciss_pci_init(h) != 0)
diff --git a/drivers/block/cciss.h b/drivers/block/cciss.h
index ae340ffc8f81..7915dd473148 100644
--- a/drivers/block/cciss.h
+++ b/drivers/block/cciss.h
@@ -103,8 +103,8 @@ struct ctlr_info
103 struct access_method access; 103 struct access_method access;
104 104
105 /* queue and queue Info */ 105 /* queue and queue Info */
106 struct hlist_head reqQ; 106 struct list_head reqQ;
107 struct hlist_head cmpQ; 107 struct list_head cmpQ;
108 unsigned int Qdepth; 108 unsigned int Qdepth;
109 unsigned int maxQsinceinit; 109 unsigned int maxQsinceinit;
110 unsigned int maxSG; 110 unsigned int maxSG;
diff --git a/drivers/block/cciss_cmd.h b/drivers/block/cciss_cmd.h
index eb060f1b00b6..35463d2f0ee7 100644
--- a/drivers/block/cciss_cmd.h
+++ b/drivers/block/cciss_cmd.h
@@ -195,7 +195,7 @@ typedef struct _CommandList_struct {
195 int ctlr; 195 int ctlr;
196 int cmd_type; 196 int cmd_type;
197 long cmdindex; 197 long cmdindex;
198 struct hlist_node list; 198 struct list_head list;
199 struct request * rq; 199 struct request * rq;
200 struct completion *waiting; 200 struct completion *waiting;
201 int retry_count; 201 int retry_count;