mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 01:10:04 +00:00
blk-mq: Add blk_mq_complete_request_direct()
Add blk_mq_complete_request_direct() which completes the block request directly instead deferring it to softirq for single queue devices. This is useful for devices which complete the requests in preemptible context and raising softirq from means scheduling ksoftirqd. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20211025070658.1565848-2-bigeasy@linutronix.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
72cd9df2ef
commit
e8dc17e289
1 changed files with 11 additions and 0 deletions
|
@ -752,6 +752,17 @@ static inline void blk_mq_set_request_complete(struct request *rq)
|
||||||
WRITE_ONCE(rq->state, MQ_RQ_COMPLETE);
|
WRITE_ONCE(rq->state, MQ_RQ_COMPLETE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Complete the request directly instead of deferring it to softirq or
|
||||||
|
* completing it another CPU. Useful in preemptible instead of an interrupt.
|
||||||
|
*/
|
||||||
|
static inline void blk_mq_complete_request_direct(struct request *rq,
|
||||||
|
void (*complete)(struct request *rq))
|
||||||
|
{
|
||||||
|
WRITE_ONCE(rq->state, MQ_RQ_COMPLETE);
|
||||||
|
complete(rq);
|
||||||
|
}
|
||||||
|
|
||||||
void blk_mq_start_request(struct request *rq);
|
void blk_mq_start_request(struct request *rq);
|
||||||
void blk_mq_end_request(struct request *rq, blk_status_t error);
|
void blk_mq_end_request(struct request *rq, blk_status_t error);
|
||||||
void __blk_mq_end_request(struct request *rq, blk_status_t error);
|
void __blk_mq_end_request(struct request *rq, blk_status_t error);
|
||||||
|
|
Loading…
Reference in a new issue