aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2009-04-06 08:48:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-06 11:04:54 -0400
commit644b2d99b7a8677a56909a7b1fde31677eba4471 (patch)
tree5271613f4fd9e6fbf11c16aff8dec8f1946b2234
parent4194b1eaf18ddc3eee9597e8800b6d2ffdfd3614 (diff)
block: enabling plugging on SSD devices that don't do queuing
For the older SSD devices that don't do command queuing, we do want to enable plugging to get better merging. Signed-off-by: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--block/blk-core.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index a32b571aaaa2..c4198f083e5b 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1136,6 +1136,15 @@ void init_request_from_bio(struct request *req, struct bio *bio)
1136 blk_rq_bio_prep(req->q, req, bio); 1136 blk_rq_bio_prep(req->q, req, bio);
1137} 1137}
1138 1138
1139/*
1140 * Only disabling plugging for non-rotational devices if it does tagging
1141 * as well, otherwise we do need the proper merging
1142 */
1143static inline bool queue_should_plug(struct request_queue *q)
1144{
1145 return !(blk_queue_nonrot(q) && blk_queue_tagged(q));
1146}
1147
1139static int __make_request(struct request_queue *q, struct bio *bio) 1148static int __make_request(struct request_queue *q, struct bio *bio)
1140{ 1149{
1141 struct request *req; 1150 struct request *req;
@@ -1242,11 +1251,11 @@ get_rq:
1242 if (test_bit(QUEUE_FLAG_SAME_COMP, &q->queue_flags) || 1251 if (test_bit(QUEUE_FLAG_SAME_COMP, &q->queue_flags) ||
1243 bio_flagged(bio, BIO_CPU_AFFINE)) 1252 bio_flagged(bio, BIO_CPU_AFFINE))
1244 req->cpu = blk_cpu_to_group(smp_processor_id()); 1253 req->cpu = blk_cpu_to_group(smp_processor_id());
1245 if (!blk_queue_nonrot(q) && elv_queue_empty(q)) 1254 if (queue_should_plug(q) && elv_queue_empty(q))
1246 blk_plug_device(q); 1255 blk_plug_device(q);
1247 add_request(q, req); 1256 add_request(q, req);
1248out: 1257out:
1249 if (unplug || blk_queue_nonrot(q)) 1258 if (unplug || !queue_should_plug(q))
1250 __generic_unplug_device(q); 1259 __generic_unplug_device(q);
1251 spin_unlock_irq(q->queue_lock); 1260 spin_unlock_irq(q->queue_lock);
1252 return 0; 1261 return 0;