Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dm rq: make dm-sq requeuing behavior consistent with dm-mq behavior

DM_MAPIO_DELAY_REQUEUE causes dm-mq to requeue after a delay but
causes dm-sq to requeue immediately. Make the behavior of dm-sq
consistent with that of dm-mq.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>

authored by

Bart Van Assche and committed by
Mike Snitzer
d5c27f3f 9157c8d3

+5 -4
+5 -4
drivers/md/dm-rq.c
··· 237 237 /* 238 238 * Requeue the original request of a clone. 239 239 */ 240 - static void dm_old_requeue_request(struct request *rq) 240 + static void dm_old_requeue_request(struct request *rq, unsigned long delay_ms) 241 241 { 242 242 struct request_queue *q = rq->q; 243 243 unsigned long flags; 244 244 245 245 spin_lock_irqsave(q->queue_lock, flags); 246 246 blk_requeue_request(q, rq); 247 - blk_run_queue_async(q); 247 + blk_delay_queue(q, delay_ms); 248 248 spin_unlock_irqrestore(q->queue_lock, flags); 249 249 } 250 250 ··· 270 270 struct mapped_device *md = tio->md; 271 271 struct request *rq = tio->orig; 272 272 int rw = rq_data_dir(rq); 273 + unsigned long delay_ms = delay_requeue ? 100 : 0; 273 274 274 275 rq_end_stats(md, rq); 275 276 if (tio->clone) { ··· 279 278 } 280 279 281 280 if (!rq->q->mq_ops) 282 - dm_old_requeue_request(rq); 281 + dm_old_requeue_request(rq, delay_ms); 283 282 else 284 - dm_mq_delay_requeue_request(rq, delay_requeue ? 100/*ms*/ : 0); 283 + dm_mq_delay_requeue_request(rq, delay_ms); 285 284 286 285 rq_completed(md, rw, false); 287 286 }