mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-13 10:02:18 +00:00
block: add block polling support
Add basic support for polling for specific IO to complete. This uses the cookie that blk-mq passes back, which enables the block layer to pass this cookie to the driver to spin for a specific request. This will be combined with request latency tracking, so we can make qualified decisions about when to poll and when not to. For now, for benchmark purposes, we add a sysfs file that controls whether polling is enabled or not. Signed-off-by: Jens Axboe <axboe@fb.com> Acked-by: Christoph Hellwig <hch@lst.de> Acked-by: Keith Busch <keith.busch@intel.com>
This commit is contained in:
parent
7b371636fb
commit
05229beedd
5 changed files with 99 additions and 0 deletions
|
@ -487,6 +487,7 @@ struct request_queue {
|
|||
#define QUEUE_FLAG_DEAD 19 /* queue tear-down finished */
|
||||
#define QUEUE_FLAG_INIT_DONE 20 /* queue is initialized */
|
||||
#define QUEUE_FLAG_NO_SG_MERGE 21 /* don't attempt to merge SG segments*/
|
||||
#define QUEUE_FLAG_POLL 22 /* IO polling enabled if set */
|
||||
|
||||
#define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \
|
||||
(1 << QUEUE_FLAG_STACKABLE) | \
|
||||
|
@ -814,6 +815,8 @@ extern int blk_execute_rq(struct request_queue *, struct gendisk *,
|
|||
extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *,
|
||||
struct request *, int, rq_end_io_fn *);
|
||||
|
||||
bool blk_poll(struct request_queue *q, blk_qc_t cookie);
|
||||
|
||||
static inline struct request_queue *bdev_get_queue(struct block_device *bdev)
|
||||
{
|
||||
return bdev->bd_disk->queue; /* this is never NULL */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue