diff options
-rw-r--r-- | block/blk-core.c | 13 |
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 | */ | ||
1143 | static inline bool queue_should_plug(struct request_queue *q) | ||
1144 | { | ||
1145 | return !(blk_queue_nonrot(q) && blk_queue_tagged(q)); | ||
1146 | } | ||
1147 | |||
1139 | static int __make_request(struct request_queue *q, struct bio *bio) | 1148 | static 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); |
1248 | out: | 1257 | out: |
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; |