diff options
Diffstat (limited to 'block/blk.h')
-rw-r--r-- | block/blk.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/block/blk.h b/block/blk.h index 61263463e38e..1f798b5a6f19 100644 --- a/block/blk.h +++ b/block/blk.h | |||
@@ -61,7 +61,26 @@ static inline struct request *__elv_next_request(struct request_queue *q) | |||
61 | rq = list_entry_rq(q->queue_head.next); | 61 | rq = list_entry_rq(q->queue_head.next); |
62 | return rq; | 62 | return rq; |
63 | } | 63 | } |
64 | 64 | /* | |
65 | * Flush request is running and flush request isn't queueable | ||
66 | * in the drive, we can hold the queue till flush request is | ||
67 | * finished. Even we don't do this, driver can't dispatch next | ||
68 | * requests and will requeue them. And this can improve | ||
69 | * throughput too. For example, we have request flush1, write1, | ||
70 | * flush 2. flush1 is dispatched, then queue is hold, write1 | ||
71 | * isn't inserted to queue. After flush1 is finished, flush2 | ||
72 | * will be dispatched. Since disk cache is already clean, | ||
73 | * flush2 will be finished very soon, so looks like flush2 is | ||
74 | * folded to flush1. | ||
75 | * Since the queue is hold, a flag is set to indicate the queue | ||
76 | * should be restarted later. Please see flush_end_io() for | ||
77 | * details. | ||
78 | */ | ||
79 | if (q->flush_pending_idx != q->flush_running_idx && | ||
80 | !queue_flush_queueable(q)) { | ||
81 | q->flush_queue_delayed = 1; | ||
82 | return NULL; | ||
83 | } | ||
65 | if (!q->elevator->ops->elevator_dispatch_fn(q, 0)) | 84 | if (!q->elevator->ops->elevator_dispatch_fn(q, 0)) |
66 | return NULL; | 85 | return NULL; |
67 | } | 86 | } |