Re: [PATCH 31/40] libata: take advantage of cmwq and remove concurrency limitations

Stefan Richter
2010-01-18T15:50:22Z

Tejun Heo wrote:
[...]
> b. ata_aux_wq which is used for SCSI probing has single thread. In
> cases where SCSI probing is stalled for extended period of time
> which is possible for ATAPI devices, this will stall all probing.

Are things like INQUIRY and possibly motor spin-up performed there?
If yes, ...

[...]
> #b is solved by using the default wq instead and achieving exclusion
> via per-port mutex.
[...]
> --- a/drivers/ata/libata-eh.c
> +++ b/drivers/ata/libata-eh.c
> @@ -727,7 +727,7 @@ void ata_scsi_error(struct Scsi_Host *host)
> if (ap->pflags & ATA_PFLAG_LOADING)
> ap->pflags &= ~ATA_PFLAG_LOADING;
> else if (ap->pflags & ATA_PFLAG_SCSI_HOTPLUG)
> - queue_delayed_work(ata_aux_wq, &ap->hotplug_task, 0);
> + schedule_delayed_work(&ap->hotplug_task, 0);
>
> if (ap->pflags & ATA_PFLAG_RECOVERED)
> ata_port_printk(ap, KERN_INFO, "EH complete\n");
> @@ -2938,7 +2938,7 @@ static int ata_eh_revalidate_and_attach(struct ata_link *link,
> ehc->i.flags |= ATA_EHI_SETMODE;
>
> /* schedule the scsi_rescan_device() here */
> - queue_work(ata_aux_wq, &(ap->scsi_rescan_task));
> + schedule_work(&(ap->scsi_rescan_task));
> } else if (dev->class == ATA_DEV_UNKNOWN &&
> ehc->tries[dev->devno] &&
> ata_class_enabled(ehc->classes[dev->devno])) {
> diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
> index f4ea5a8..08e2ef8 100644
> --- a/drivers/ata/libata-scsi.c
> +++ b/drivers/ata/libata-scsi.c
> @@ -3408,8 +3408,7 @@ void ata_scsi_scan_host(struct ata_port *ap, int sync)
> " switching to async\n");
> }
>
> - queue_delayed_work(ata_aux_wq, &ap->hotplug_task,
> - round_jiffies_relative(HZ));
> + schedule_delayed_work(&ap->hotplug_task, round_jiffies_relative(HZ));
> }
>
> /**
[...]

... wouldn't queue_delayed_work(system_long_wq, &ap->hotplug_task, ...);
be more appropriate then?
--
Stefan Richter
-=====-==-=- ---= =--=-