diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-18 09:49:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-18 09:49:02 -0400 |
commit | a2b9c1f6208126e6df6c02428c501f8853685812 (patch) | |
tree | e36762d385bb490914a72485c4da4431e4b937d3 /drivers/scsi | |
parent | 2e9521fd656f05a716b5294a7dbebd37ced05e43 (diff) | |
parent | 3ec717b7ca4ee1d75d77e4f6286430d8f01d1dbd (diff) |
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
block: don't delay blk_run_queue_async
scsi: remove performance regression due to async queue run
blk-throttle: Use task_subsys_state() to determine a task's blkio_cgroup
block: rescan partitions on invalidated devices on -ENOMEDIA too
cdrom: always check_disk_change() on open
block: unexport DISK_EVENT_MEDIA_CHANGE for legacy/fringe drivers
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/scsi_lib.c | 20 | ||||
-rw-r--r-- | drivers/scsi/scsi_scan.c | 2 |
2 files changed, 18 insertions, 4 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 0bac91e72370..ec1803a48723 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -74,8 +74,6 @@ struct kmem_cache *scsi_sdb_cache; | |||
74 | */ | 74 | */ |
75 | #define SCSI_QUEUE_DELAY 3 | 75 | #define SCSI_QUEUE_DELAY 3 |
76 | 76 | ||
77 | static void scsi_run_queue(struct request_queue *q); | ||
78 | |||
79 | /* | 77 | /* |
80 | * Function: scsi_unprep_request() | 78 | * Function: scsi_unprep_request() |
81 | * | 79 | * |
@@ -161,7 +159,7 @@ static int __scsi_queue_insert(struct scsi_cmnd *cmd, int reason, int unbusy) | |||
161 | blk_requeue_request(q, cmd->request); | 159 | blk_requeue_request(q, cmd->request); |
162 | spin_unlock_irqrestore(q->queue_lock, flags); | 160 | spin_unlock_irqrestore(q->queue_lock, flags); |
163 | 161 | ||
164 | scsi_run_queue(q); | 162 | kblockd_schedule_work(q, &device->requeue_work); |
165 | 163 | ||
166 | return 0; | 164 | return 0; |
167 | } | 165 | } |
@@ -438,7 +436,11 @@ static void scsi_run_queue(struct request_queue *q) | |||
438 | continue; | 436 | continue; |
439 | } | 437 | } |
440 | 438 | ||
441 | blk_run_queue_async(sdev->request_queue); | 439 | spin_unlock(shost->host_lock); |
440 | spin_lock(sdev->request_queue->queue_lock); | ||
441 | __blk_run_queue(sdev->request_queue); | ||
442 | spin_unlock(sdev->request_queue->queue_lock); | ||
443 | spin_lock(shost->host_lock); | ||
442 | } | 444 | } |
443 | /* put any unprocessed entries back */ | 445 | /* put any unprocessed entries back */ |
444 | list_splice(&starved_list, &shost->starved_list); | 446 | list_splice(&starved_list, &shost->starved_list); |
@@ -447,6 +449,16 @@ static void scsi_run_queue(struct request_queue *q) | |||
447 | blk_run_queue(q); | 449 | blk_run_queue(q); |
448 | } | 450 | } |
449 | 451 | ||
452 | void scsi_requeue_run_queue(struct work_struct *work) | ||
453 | { | ||
454 | struct scsi_device *sdev; | ||
455 | struct request_queue *q; | ||
456 | |||
457 | sdev = container_of(work, struct scsi_device, requeue_work); | ||
458 | q = sdev->request_queue; | ||
459 | scsi_run_queue(q); | ||
460 | } | ||
461 | |||
450 | /* | 462 | /* |
451 | * Function: scsi_requeue_command() | 463 | * Function: scsi_requeue_command() |
452 | * | 464 | * |
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 087821fac8fe..58584dc0724a 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c | |||
@@ -242,6 +242,7 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget, | |||
242 | int display_failure_msg = 1, ret; | 242 | int display_failure_msg = 1, ret; |
243 | struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); | 243 | struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); |
244 | extern void scsi_evt_thread(struct work_struct *work); | 244 | extern void scsi_evt_thread(struct work_struct *work); |
245 | extern void scsi_requeue_run_queue(struct work_struct *work); | ||
245 | 246 | ||
246 | sdev = kzalloc(sizeof(*sdev) + shost->transportt->device_size, | 247 | sdev = kzalloc(sizeof(*sdev) + shost->transportt->device_size, |
247 | GFP_ATOMIC); | 248 | GFP_ATOMIC); |
@@ -264,6 +265,7 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget, | |||
264 | INIT_LIST_HEAD(&sdev->event_list); | 265 | INIT_LIST_HEAD(&sdev->event_list); |
265 | spin_lock_init(&sdev->list_lock); | 266 | spin_lock_init(&sdev->list_lock); |
266 | INIT_WORK(&sdev->event_work, scsi_evt_thread); | 267 | INIT_WORK(&sdev->event_work, scsi_evt_thread); |
268 | INIT_WORK(&sdev->requeue_work, scsi_requeue_run_queue); | ||
267 | 269 | ||
268 | sdev->sdev_gendev.parent = get_device(&starget->dev); | 270 | sdev->sdev_gendev.parent = get_device(&starget->dev); |
269 | sdev->sdev_target = starget; | 271 | sdev->sdev_target = starget; |