On Wed, Nov 30, 2011 at 09:51:44PM +0000, Nicholas A. Bellinger wrote: > From: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx> > > Historically, pSCSI devices have been the ones that required target-core > to enforce a per se_device->depth_left. This patch changes target-core > to no longer (by default) enforce a per se_device->depth_left or sleep in > transport_tcq_window_closed() when we out of queue slots. > > It adds se_device->enforce_dev_tcq bitfield + se_subsystem_dev->su_dev_flags > SDF_ENFORCE_DEVICE_TCQ to signal the legacy usage in target-core with pSCSI. > So now aside from this special case, IBLOCK, FILEIO and RAMDISK with > ->enforce_dev_tcq=0 by default. What does pscsi actually need it for? I'd really much prefer either getting rid of this entirely, or if that isn't possible moving it into pscsi, including proper comments describing why it is needed there over adding more flags to subtly different behaviour. > + /* > + * Only setup and enforce the se_device queue depth for > + * pSCSI backends using SDF_ENFORCE_DEVICE_TCQ. > + */ > + if (se_dev->su_dev_flags & SDF_ENFORCE_DEVICE_TCQ) { The comment doesn't add much value.. > + if (dev->enforce_dev_tcq) { > + if (!dev->depth_left) { > + spin_unlock_irq(&dev->execute_task_lock); > + return transport_tcq_window_closed(dev); > + } > + dev->dev_tcq_window_closed = 0; > + } Also note that the current transport_tcq_window_closed code is really dumb. There is absolutely no need for the sleep, instead the code incrementing depth_left should do a wakeup on dev->dev_queue_obj.thread_wq. -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html