Re: [PATCH] memory mapping for usbfs (v0.4)

2013-10-05 Thread Ming Lei
On Sat, Oct 5, 2013 at 4:34 AM, Alan Stern st...@rowland.harvard.edu wrote: On Fri, 4 Oct 2013, Markus Rechberger wrote: I was only testing reading the data so I didn't see any caching effects since I don't have a device or driver which I can send a lot data out. As far as I understand

Re: [PATCH] memory mapping for usbfs (v0.4)

2013-10-05 Thread Alan Stern
On Sat, 5 Oct 2013, Ming Lei wrote: The buffer should be cached. The userspace program will have to make sure that it doesn't try to access the buffer while DMA is in progress. As long as that restriction is obeyed, the USB core will take care of mapping the buffer for DMA (which flushes

Re: [PATCH] memory mapping for usbfs (v0.4)

2013-10-05 Thread Ming Lei
On Sat, Oct 5, 2013 at 11:10 PM, Alan Stern st...@rowland.harvard.edu wrote: On Sat, 5 Oct 2013, Ming Lei wrote: The buffer should be cached. The userspace program will have to make sure that it doesn't try to access the buffer while DMA is in progress. As long as that restriction is

Re: [PATCH] memory mapping for usbfs (v0.4)

2013-10-04 Thread Markus Rechberger
On Mon, Sep 30, 2013 at 5:12 PM, Markus Rechberger mrechber...@gmail.com wrote: On Mon, Sep 30, 2013 at 4:59 PM, Alan Stern st...@rowland.harvard.edu wrote: On Mon, 30 Sep 2013, Markus Rechberger wrote: to explain why Isochronous makes such a difference, the kernel driver doesn't do the

Re: [PATCH] memory mapping for usbfs (v0.4)

2013-10-04 Thread Alan Stern
On Sun, 29 Sep 2013, Markus Rechberger wrote: This patch adds memory mapping support to USBFS for isochronous and bulk data transfers, it allows to pre-allocate usb transfer buffers. The CPU usage decreases 1-2% on my 1.3ghz U7300 notebook The CPU usage decreases 6-8% on an Intel Atom n270

Re: [PATCH] memory mapping for usbfs (v0.4)

2013-10-04 Thread Markus Rechberger
On Fri, Oct 4, 2013 at 8:41 PM, Alan Stern st...@rowland.harvard.edu wrote: On the whole this seems reasonable. There are a few stylistic things that could be cleaned up (missing blank lines after variable declarations, for example, and other checkpatch issues), but they are minor. Why do

Re: [PATCH] memory mapping for usbfs (v0.4)

2013-10-04 Thread Alan Stern
On Fri, 4 Oct 2013, Markus Rechberger wrote: The biggest problem is that your proc_alloc_memory() routine doesn't call usbfs_increase_memory_usage(). Without that, there's nothing to prevent a user from allocating all the available kernel memory. only root is supposed to have raw USB

Re: [PATCH] memory mapping for usbfs (v0.4)

2013-10-04 Thread Markus Rechberger
On Fri, Oct 4, 2013 at 10:34 PM, Alan Stern st...@rowland.harvard.edu wrote: On Fri, 4 Oct 2013, Markus Rechberger wrote: The biggest problem is that your proc_alloc_memory() routine doesn't call usbfs_increase_memory_usage(). Without that, there's nothing to prevent a user from

Re: [PATCH] memory mapping for usbfs (v0.4)

2013-09-30 Thread Markus Rechberger
On Mon, Sep 30, 2013 at 5:51 AM, Marcel Holtmann mar...@holtmann.org wrote: Hi Markus, Do you have a userspace test program that we can use to verify that this does work, and that others can use to run on some different platforms to verify that this is actually faster? You will need one of

Re: [PATCH] memory mapping for usbfs (v0.4)

2013-09-30 Thread Markus Rechberger
On Mon, Sep 30, 2013 at 1:26 PM, Markus Rechberger mrechber...@gmail.com wrote: On Mon, Sep 30, 2013 at 5:51 AM, Marcel Holtmann mar...@holtmann.org wrote: Hi Markus, Do you have a userspace test program that we can use to verify that this does work, and that others can use to run on some

Re: [PATCH] memory mapping for usbfs (v0.4)

2013-09-30 Thread Alan Stern
On Mon, 30 Sep 2013, Markus Rechberger wrote: to explain why Isochronous makes such a difference, the kernel driver doesn't do the memset anymore for each urb packet. However that patch addresses multiple issues * Isochronous improvement by removing memset for each packet * Pre-Allocation to

Re: [PATCH] memory mapping for usbfs (v0.4)

2013-09-30 Thread Markus Rechberger
On Mon, Sep 30, 2013 at 4:59 PM, Alan Stern st...@rowland.harvard.edu wrote: On Mon, 30 Sep 2013, Markus Rechberger wrote: to explain why Isochronous makes such a difference, the kernel driver doesn't do the memset anymore for each urb packet. However that patch addresses multiple issues *

[PATCH] memory mapping for usbfs (v0.4)

2013-09-29 Thread Markus Rechberger
This patch adds memory mapping support to USBFS for isochronous and bulk data transfers, it allows to pre-allocate usb transfer buffers. The CPU usage decreases 1-2% on my 1.3ghz U7300 notebook The CPU usage decreases 6-8% on an Intel Atom n270 when transferring 20mbyte/sec (isochronous), it

Re: [PATCH] memory mapping for usbfs (v0.4)

2013-09-29 Thread Ming Lei
On Sun, Sep 29, 2013 at 10:02 PM, Markus Rechberger mrechber...@gmail.com wrote: This patch adds memory mapping support to USBFS for isochronous and bulk data transfers, it allows to pre-allocate usb transfer buffers. The CPU usage decreases 1-2% on my 1.3ghz U7300 notebook The CPU usage

Re: [PATCH] memory mapping for usbfs (v0.4)

2013-09-29 Thread Greg KH
On Sun, Sep 29, 2013 at 04:02:56PM +0200, Markus Rechberger wrote: This patch adds memory mapping support to USBFS for isochronous and bulk data transfers, it allows to pre-allocate usb transfer buffers. The CPU usage decreases 1-2% on my 1.3ghz U7300 notebook The CPU usage decreases 6-8% on

Re: [PATCH] memory mapping for usbfs (v0.4)

2013-09-29 Thread Markus Rechberger
On Sun, Sep 29, 2013 at 5:14 PM, Greg KH gre...@linuxfoundation.org wrote: On Sun, Sep 29, 2013 at 04:02:56PM +0200, Markus Rechberger wrote: This patch adds memory mapping support to USBFS for isochronous and bulk data transfers, it allows to pre-allocate usb transfer buffers. The CPU usage

Re: [PATCH] memory mapping for usbfs (v0.4)

2013-09-29 Thread Markus Rechberger
On Sun, Sep 29, 2013 at 4:24 PM, Ming Lei tom.leim...@gmail.com wrote: On Sun, Sep 29, 2013 at 10:02 PM, Markus Rechberger mrechber...@gmail.com wrote: This patch adds memory mapping support to USBFS for isochronous and bulk data transfers, it allows to pre-allocate usb transfer buffers. The

Re: [PATCH] memory mapping for usbfs (v0.4)

2013-09-29 Thread Greg KH
On Sun, Sep 29, 2013 at 07:32:56PM +0200, Markus Rechberger wrote: On Sun, Sep 29, 2013 at 5:14 PM, Greg KH gre...@linuxfoundation.org wrote: On Sun, Sep 29, 2013 at 04:02:56PM +0200, Markus Rechberger wrote: This patch adds memory mapping support to USBFS for isochronous and bulk data

Re: [PATCH] memory mapping for usbfs (v0.4)

2013-09-29 Thread Markus Rechberger
On Sun, Sep 29, 2013 at 9:01 PM, Greg KH gre...@linuxfoundation.org wrote: On Sun, Sep 29, 2013 at 07:32:56PM +0200, Markus Rechberger wrote: On Sun, Sep 29, 2013 at 5:14 PM, Greg KH gre...@linuxfoundation.org wrote: On Sun, Sep 29, 2013 at 04:02:56PM +0200, Markus Rechberger wrote: This

Re: [PATCH] memory mapping for usbfs (v0.4)

2013-09-29 Thread Alan Stern
On Sun, 29 Sep 2013, Markus Rechberger wrote: Do you have a userspace test program that we can use to verify that this does work, and that others can use to run on some different platforms to verify that this is actually faster? You will need one of our devices for testing I

Re: [PATCH] memory mapping for usbfs (v0.4)

2013-09-29 Thread Markus Rechberger
On Sun, Sep 29, 2013 at 9:58 PM, Alan Stern st...@rowland.harvard.edu wrote: On Sun, 29 Sep 2013, Markus Rechberger wrote: Do you have a userspace test program that we can use to verify that this does work, and that others can use to run on some different platforms to verify that this

Re: [PATCH] memory mapping for usbfs (v0.4)

2013-09-29 Thread Marcel Holtmann
Hi Markus, Do you have a userspace test program that we can use to verify that this does work, and that others can use to run on some different platforms to verify that this is actually faster? You will need one of our devices for testing I guess. Some scanners (which use USBFS) or other