Cc: James Bottomley <James.Bottomley@...>, Linus Torvalds <torvalds@...>, Andrew Morton <akpm@...>, FUJITA Tomonori <fujita.tomonori@...>, <linux-scsi@...>, <scst-devel@...>, <linux-kernel@...>, Nicholas A. Bellinger <nab@...>
It isn't fully correct, you forgot about link latency. More correct one is:
(transfer time) = (transfer setup latency on both initiator and target,
consisting from software processing time, including memory copy, if
necessary, and PCI setup/transfer time) + (transfer size)/(bandwidth) +
(link latency to deliver request for READs or status for WRITES) +
(2*(link latency) to deliver R2T/XFER_READY request in case of WRITEs,
if necessary (e.g. iSER for small transfers might not need it, but SRP
most likely always needs it)). Also you should note that it's correct
only in case of single threaded workloads with one outstanding command
at time. For other workloads it depends from how well they manage to
keep the "link" full in interval from (transfer size)/(transfer time) to
bandwidth.
Unfortunately, it isn't so easy, see above.
Look at /proc/scsi_tgt/sgv (for SCST) and you will see, which transfer
sizes are actually used. Initiators don't like sending big requests and
often split them on smaller ones.
Look at this message as well, it might be helpful:
http://lkml.org/lkml/2007/5/16/223
--