forked from luck/tmp_suning_uos_patched
30a91cb4ef
Rework I/O completions to work more like the old code path. blk_mq_end_io now stays out of the business of deferring completions to others CPUs and calling blk_mark_rq_complete. The latter is very important to allow completing requests that have timed out and thus are already marked completed, the former allows using the IPI callout even for driver specific completions instead of having to reimplement them. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
53 lines
1.4 KiB
C
53 lines
1.4 KiB
C
#ifndef INT_BLK_MQ_H
|
|
#define INT_BLK_MQ_H
|
|
|
|
struct blk_mq_ctx {
|
|
struct {
|
|
spinlock_t lock;
|
|
struct list_head rq_list;
|
|
} ____cacheline_aligned_in_smp;
|
|
|
|
unsigned int cpu;
|
|
unsigned int index_hw;
|
|
unsigned int ipi_redirect;
|
|
|
|
/* incremented at dispatch time */
|
|
unsigned long rq_dispatched[2];
|
|
unsigned long rq_merged;
|
|
|
|
/* incremented at completion time */
|
|
unsigned long ____cacheline_aligned_in_smp rq_completed[2];
|
|
|
|
struct request_queue *queue;
|
|
struct kobject kobj;
|
|
};
|
|
|
|
void __blk_mq_complete_request(struct request *rq);
|
|
void blk_mq_run_request(struct request *rq, bool run_queue, bool async);
|
|
void blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async);
|
|
void blk_mq_init_flush(struct request_queue *q);
|
|
void blk_mq_drain_queue(struct request_queue *q);
|
|
void blk_mq_free_queue(struct request_queue *q);
|
|
|
|
/*
|
|
* CPU hotplug helpers
|
|
*/
|
|
struct blk_mq_cpu_notifier;
|
|
void blk_mq_init_cpu_notifier(struct blk_mq_cpu_notifier *notifier,
|
|
void (*fn)(void *, unsigned long, unsigned int),
|
|
void *data);
|
|
void blk_mq_register_cpu_notifier(struct blk_mq_cpu_notifier *notifier);
|
|
void blk_mq_unregister_cpu_notifier(struct blk_mq_cpu_notifier *notifier);
|
|
void blk_mq_cpu_init(void);
|
|
|
|
/*
|
|
* CPU -> queue mappings
|
|
*/
|
|
struct blk_mq_reg;
|
|
extern unsigned int *blk_mq_make_queue_map(struct blk_mq_reg *reg);
|
|
extern int blk_mq_update_queue_map(unsigned int *map, unsigned int nr_queues);
|
|
|
|
void blk_mq_add_timer(struct request *rq);
|
|
|
|
#endif
|