On Fri, Nov 13, 2015 at 03:20:56PM -0500, Alan Stern wrote: >> I tried just not setting as->userbuffer if usbm == NULL, and lo and behold, >> it actually seems to help. > In fact, there's no need to call copy_urb_data_to_user at all if the > buffer lies in the mmap'ed area. usbm != NULL is meant to signal this. It only checks for exact match, though, not containment. (Well, matching start; the size can be smaller.) >> I'm wondering if the copy is just from the buffer >> to itself? > Yes, it is. I can't imagine why this wasn't handled in the original > patch. Simple oversight? Or perhaps something changed between patch submission and now? Or maybe it was never properly tested. I don't know. >> copy_user_enhanced_fast_string is now down at 0.26%, ie. >> effectively nothing. > Very good. Of course, not all if this gets translated to actual savings. Previously, the data copy faulted data in from main memory (lots of L3 misses), and that cost now gets moved into my own userspace code. But that's fine; it's got to be somewhere. So what is the road from here? I guess the original questions about cache coherency still apply, and that this is what I'm seeing in dmesg. /* Steinar */ -- Homepage: https://www.sesse.net/ -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html