Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

nvme-pci: remove last_sq_tail

The nvme driver does not have enough tags to wrap the queue, and blk-mq
will no longer call commit_rqs() when there are no new submissions to
notify.

Signed-off-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Keith Busch and committed by
Jens Axboe
54b2fcee 74943d45

+4 -19
+4 -19
drivers/nvme/host/pci.c
··· 173 173 u16 q_depth; 174 174 u16 cq_vector; 175 175 u16 sq_tail; 176 - u16 last_sq_tail; 177 176 u16 cq_head; 178 177 u16 qid; 179 178 u8 cq_phase; ··· 445 446 return 0; 446 447 } 447 448 448 - /* 449 - * Write sq tail if we are asked to, or if the next command would wrap. 450 - */ 451 - static inline void nvme_write_sq_db(struct nvme_queue *nvmeq, bool write_sq) 449 + static inline void nvme_write_sq_db(struct nvme_queue *nvmeq) 452 450 { 453 - if (!write_sq) { 454 - u16 next_tail = nvmeq->sq_tail + 1; 455 - 456 - if (next_tail == nvmeq->q_depth) 457 - next_tail = 0; 458 - if (next_tail != nvmeq->last_sq_tail) 459 - return; 460 - } 461 - 462 451 if (nvme_dbbuf_update_and_check_event(nvmeq->sq_tail, 463 452 nvmeq->dbbuf_sq_db, nvmeq->dbbuf_sq_ei)) 464 453 writel(nvmeq->sq_tail, nvmeq->q_db); 465 - nvmeq->last_sq_tail = nvmeq->sq_tail; 466 454 } 467 455 468 456 /** ··· 466 480 cmd, sizeof(*cmd)); 467 481 if (++nvmeq->sq_tail == nvmeq->q_depth) 468 482 nvmeq->sq_tail = 0; 469 - nvme_write_sq_db(nvmeq, write_sq); 483 + if (write_sq) 484 + nvme_write_sq_db(nvmeq); 470 485 spin_unlock(&nvmeq->sq_lock); 471 486 } 472 487 ··· 476 489 struct nvme_queue *nvmeq = hctx->driver_data; 477 490 478 491 spin_lock(&nvmeq->sq_lock); 479 - if (nvmeq->sq_tail != nvmeq->last_sq_tail) 480 - nvme_write_sq_db(nvmeq, true); 492 + nvme_write_sq_db(nvmeq); 481 493 spin_unlock(&nvmeq->sq_lock); 482 494 } 483 495 ··· 1480 1494 struct nvme_dev *dev = nvmeq->dev; 1481 1495 1482 1496 nvmeq->sq_tail = 0; 1483 - nvmeq->last_sq_tail = 0; 1484 1497 nvmeq->cq_head = 0; 1485 1498 nvmeq->cq_phase = 1; 1486 1499 nvmeq->q_db = &dev->dbs[qid * 2 * dev->db_stride];