]> git.neil.brown.name Git - history.git/commitdiff
fix queue plug performance problem found by akpm
authorJames Bottomley <jejb@mulgrave.(none)>
Wed, 20 Nov 2002 04:52:55 +0000 (22:52 -0600)
committerChristoph Hellwig <hch@lst.de>
Wed, 20 Nov 2002 04:52:55 +0000 (22:52 -0600)
Fix is to only plug on prep deferral if the device queue is empty
(otherwise we can rely on returning I/O to restart the queue)

drivers/scsi/scsi_lib.c

index 7d4ef17f3cc2b16ddd3cc09feb802d5d4f55defb..d3f5ffb994d0a8654fee2f8cc66e76f054a7f0b5 100644 (file)
@@ -984,10 +984,11 @@ void scsi_request_fn(request_queue_t * q)
                        break;
 
                if(!req) {
-                       /* can happen if the prep fails 
-                        * FIXME: elv_next_request() should be plugging the
-                        * queue */
-                       blk_plug_device(q);
+                       /* If the device is busy, a returning I/O
+                        * will restart the queue.  Otherwise, we have
+                        * to plug the queue */
+                       if(SDpnt->device_busy == 0)
+                               blk_plug_device(q);
                        break;
                }