aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2014-05-28 10:08:02 -0400
committerJens Axboe <axboe@fb.com>2014-05-28 10:08:02 -0400
commit6fca6a611c27f1f0d90fbe1cc3c229dbf8c09e48 (patch)
treed3348f3ab1169db9b5a1fca67a8fd2164152530c /include
parent7738dac4f697ffbd0ed4c4aeb69a714ef9d876da (diff)
blk-mq: add helper to insert requests from irq context
Both the cache flush state machine and the SCSI midlayer want to submit requests from irq context, and the current per-request requeue_work unfortunately causes corruption due to sharing with the csd field for flushes. Replace them with a per-request_queue list of requests to be requeued. Based on an earlier test by Ming Lei. Signed-off-by: Christoph Hellwig <hch@lst.de> Reported-by: Ming Lei <tom.leiming@gmail.com> Tested-by: Ming Lei <tom.leiming@gmail.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/blk-mq.h2
-rw-r--r--include/linux/blkdev.h5
2 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index 5b171fbe95c5..b9a74a386dbc 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -172,6 +172,8 @@ void blk_mq_end_io(struct request *rq, int error);
172void __blk_mq_end_io(struct request *rq, int error); 172void __blk_mq_end_io(struct request *rq, int error);
173 173
174void blk_mq_requeue_request(struct request *rq); 174void blk_mq_requeue_request(struct request *rq);
175void blk_mq_add_to_requeue_list(struct request *rq, bool at_head);
176void blk_mq_kick_requeue_list(struct request_queue *q);
175void blk_mq_complete_request(struct request *rq); 177void blk_mq_complete_request(struct request *rq);
176 178
177void blk_mq_stop_hw_queue(struct blk_mq_hw_ctx *hctx); 179void blk_mq_stop_hw_queue(struct blk_mq_hw_ctx *hctx);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 6bc011a09e82..913f1c2d3be0 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -99,7 +99,6 @@ struct request {
99 struct list_head queuelist; 99 struct list_head queuelist;
100 union { 100 union {
101 struct call_single_data csd; 101 struct call_single_data csd;
102 struct work_struct requeue_work;
103 unsigned long fifo_time; 102 unsigned long fifo_time;
104 }; 103 };
105 104
@@ -463,6 +462,10 @@ struct request_queue {
463 struct request *flush_rq; 462 struct request *flush_rq;
464 spinlock_t mq_flush_lock; 463 spinlock_t mq_flush_lock;
465 464
465 struct list_head requeue_list;
466 spinlock_t requeue_lock;
467 struct work_struct requeue_work;
468
466 struct mutex sysfs_lock; 469 struct mutex sysfs_lock;
467 470
468 int bypass_depth; 471 int bypass_depth;