basler / linux-usb-zerocopy

usb3 zerocopy support for linux
https://github.com/Basler/linux-usb-zerocopy/wiki
Other
4 stars 2 forks source link

Add the user-space memory to the usbfs emory tracker #2

Open stefanklug opened 9 years ago

stefanklug commented 9 years ago

From: http://article.gmane.org/gmane.linux.usb.general/110775

check which compares the number of required pages to ps->dev->bus->sg_tablesize. It seems to me that the check is per call, so using multiple calls one could still pin unlimited amounts of memory. usbfs keeps track of the total amount of pinned memory and enforces an overall limit. It will be necessary to add the size of the transfer buffer to that total.

Leaving the zerocopy transfers out of this limit was intentional. I thought this is user-memory so we shouldn't add it to the overall limit as it is not allocated by usbfs. But I didn't think of the pinning problem. So yes, I can add it to the overall limit.