]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: remove performance regression due to async queue run
authorJens Axboe <jaxboe@fusionio.com>
Tue, 17 May 2011 09:04:44 +0000 (11:04 +0200)
committerJens Axboe <jaxboe@fusionio.com>
Tue, 17 May 2011 09:04:44 +0000 (11:04 +0200)
commita4435999eb8b826ae8c07d111ae2d8ba83f96c50
tree0448e96b503deb71dd8a1228da94a9fc22a57d48
parentb0007e94ad0af5b2643abcc2a5252980487bebbf
scsi: remove performance regression due to async queue run

Commit 6056ed45 removed our queue request_fn re-enter
protection, and defaulted to always running the queues from
kblockd to be safe. This was a known potential slow down,
but should be safe.

Unfortunately this is causing big performance regressions for
some, so we need to improve this logic. Looking into the details
of the re-enter, the real issue is on requeue of requests.

Requeue of requests upon seeing a BUSY condition from the device
ends up re-running the queue, causing traces like this:

scsi_request_fn()
        scsi_dispatch_cmd()
                scsi_queue_insert()
                        __scsi_queue_insert()
                                scsi_run_queue()
scsi_request_fn()
...

potentially causing the issue we want to avoid. So special
case the requeue re-run of the queue, but improve it to offload
the entire run of local queue and starved queue from a single
workqueue callback. This is a lot better than potentially
kicking off a workqueue run for each device seen.

This also fixes the issue of the local device going into recursion,
since the above mentioned commit never moved that queue run out
of line.

Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
drivers/scsi/scsi_lib.c
drivers/scsi/scsi_scan.c
include/scsi/scsi_device.h