aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-tag.c
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2009-05-20 02:54:31 -0400
committerJens Axboe <jens.axboe@oracle.com>2009-05-20 02:54:31 -0400
commit0a7ae2ff0d29bb3b327edff4c8ab67b3834fa811 (patch)
tree88309ac99a39e15b9b23525a00a15b1564957b32 /block/blk-tag.c
parentac36552a52a6ec8563ac0a109e2a0935673f4abb (diff)
block: change the tag sync vs async restriction logic
Make them fully share the tag space, but disallow async requests using the last any two slots. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/blk-tag.c')
-rw-r--r--block/blk-tag.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/block/blk-tag.c b/block/blk-tag.c
index c260f7c30dd..2e5cfeb5933 100644
--- a/block/blk-tag.c
+++ b/block/blk-tag.c
@@ -336,7 +336,7 @@ EXPORT_SYMBOL(blk_queue_end_tag);
336int blk_queue_start_tag(struct request_queue *q, struct request *rq) 336int blk_queue_start_tag(struct request_queue *q, struct request *rq)
337{ 337{
338 struct blk_queue_tag *bqt = q->queue_tags; 338 struct blk_queue_tag *bqt = q->queue_tags;
339 unsigned max_depth, offset; 339 unsigned max_depth;
340 int tag; 340 int tag;
341 341
342 if (unlikely((rq->cmd_flags & REQ_QUEUED))) { 342 if (unlikely((rq->cmd_flags & REQ_QUEUED))) {
@@ -355,13 +355,16 @@ int blk_queue_start_tag(struct request_queue *q, struct request *rq)
355 * to starve sync IO on behalf of flooding async IO. 355 * to starve sync IO on behalf of flooding async IO.
356 */ 356 */
357 max_depth = bqt->max_depth; 357 max_depth = bqt->max_depth;
358 if (rq_is_sync(rq)) 358 if (!rq_is_sync(rq) && max_depth > 1) {
359 offset = 0; 359 max_depth -= 2;
360 else 360 if (!max_depth)
361 offset = max_depth >> 2; 361 max_depth = 1;
362 if (q->in_flight[0] > max_depth)
363 return 1;
364 }
362 365
363 do { 366 do {
364 tag = find_next_zero_bit(bqt->tag_map, max_depth, offset); 367 tag = find_first_zero_bit(bqt->tag_map, max_depth);
365 if (tag >= max_depth) 368 if (tag >= max_depth)
366 return 1; 369 return 1;
367 370