On Fri, 9 Oct 2015, Felipe Balbi wrote:

> that's all clear :-) The point is that I _do_ get a ton of PINGs because
> the gadget doesn't queue requests fast enough and I'm, currently,
> blaming the latency of the kthread() itself, though I haven't been
> successful at proving that statement thus far.

Do you get similar PINGs between buffers?  Unless you've changed from
the default, each buffer is 16 KB so delays would show up at intervals 
of 32 bulk packets.

If you do see a lot of them, it means that either the data rate from
the backing file is slower than the USB transfer rate or that
usb_request submission overhead is taking too much time.  You can test 
this by increasing FSG_BUFSIZE in storage_common.h and seeing if the 
behavior changes.

If you don't see them, it means that initial scheduling of the kthread
takes too long, as you guessed.  But this doesn't say why scheduling of
the kthread between buffers is quick.  One possible reason would be
that the rates are so well matched that each time the kthread wants to
fill a new buffer, one of the in-flight buffers has completed and is 
available for re-use.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to