Re: [PATCH 7/7] blk-mq: don't use the requeue list to queue flush commands

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/16/23 13:09, Christoph Hellwig wrote:
diff --git a/block/blk-flush.c b/block/blk-flush.c
index 69e9806f575455..231d3780e74ad1 100644
--- a/block/blk-flush.c
+++ b/block/blk-flush.c
@@ -188,7 +188,9 @@ static void blk_flush_complete_seq(struct request *rq,
case REQ_FSEQ_DATA:
  		list_move_tail(&rq->flush.list, &fq->flush_data_in_flight);
-		blk_mq_add_to_requeue_list(rq, 0);
+		spin_lock(&q->requeue_lock);
+		list_add_tail(&rq->queuelist, &q->flush_list);
+		spin_unlock(&q->requeue_lock);
  		blk_mq_kick_requeue_list(q);
  		break;

At least the SCSI core can call blk_flush_complete_seq() from interrupt context so I don't think the above code is correct. The call chain is as follows:

LLD interrupt handler
  scsi_done()
    scsi_done_internal()
      blk_mq_complete_request()
        scsi_complete()
          scsi_finish_command()
            scsi_io_completion()
              scsi_end_request()
                __blk_mq_end_request()
                  flush_end_io()
                    blk_flush_complete_seq()

Bart.



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux