Re: [PATCH] Increase usbfs bulk buffer size

From: Markus Rechberger
Date: Wed Aug 17 2011 - 13:44:21 EST


Hi,

On Wed, Aug 17, 2011 at 7:14 PM, Oliver Neukum <oliver@xxxxxxxxxx> wrote:
> Am Mittwoch, 17. August 2011, 19:07:01 schrieb Markus Rechberger:
>> Hi,
>>
>> this patch increases the maximum buffersize for bulk transfers, our
>> devices support at least up to 46k bytes for bulk transfers.
>> This patch allows us to lower the iterations between kernel and
>> userspace and lower the system pressure.
>
> You must not do this. It increases memory pressure too much
> by forcing very high order allocations. If your problem is really
> the number of syscalls, you must implement scatter/gather.
>

I understand that USBFS is not 100% optimized, although we are already
using 3-4 times that much buffer with isochronous and it was working
fine for years so far as long as the system doesn't run out of memory
.. but even kerneldrivers would have issues with it in such a
situation.

An example analog video frames 170 mbit per second
~3000 bytes * 64 microframes = 192000

The bulk buffers we are asking for are for encoded videostreams, which
is much smaller than analog TV frames.
So for bulk we are just asking for around 1/4 of that buffersize.
Our application works fine with USBFS in Isochronous mode, however
some embedded systems don't support Isochronous so we are switching to
Bulk. I submitted the Isochronous patch for accepting bigger buffers
around 1-2 years ago the allocations and iterations went down from 600
to around 125 per second. For the enduser exerience since that time
it's possible to start heavy IO/memory applications without hurting
the video process.

BR,
Markus

>        Regards
>                Ôliver
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/