logoalt Hacker News

bobmcnamara • today at 4:28 PM • 0 replies • view on HN

I hope things are better now, but there used to be 1.5 poor choices:

1) use uncached DMA buffers 2) manage cache host CPU coherency by hand. 3) hope you only ran on hardware cache coherent architectures

And the kernel didn't give you everything you needed to do #2.

Just reading a USB2 480p webcam on a raspberry pi burned half the CPU kernel memcpying pixels from uncached DMA rx buffer to cacheable buffer. At least the camera is a linear copy, but the USB packets are relatively small.