high-order allocation + highmem + streaming DMA - possible?

October 19th, 2011 - 03:00 am ET by Nikita V. Youshchenko | Report spam
Hello.

We are writing a driver for a custom PCI device that receives large amount
of data.

Device is capable of DMAing received data in 64k chunks.

We have been going to:
- use physically-continuous 64k-sized memory areas using alloc_pages() with
order=4,
- allocate large number of such areas on driver init,
- implement mmap() to map those all to userspace for zero-copy processing,
- use streaming DMA to actually receive data

However I can't find a way to use streaming DMA for large highmem areas.
- pci_map_single() is for linear mapping and can't work with highmem
- pci_map_page() can work with highmem but is limited to one page
- pci_map_sg() is for s/g lists, not for single 64k blocks.

Is there a way to use streaming DMA with large memory areas located in
highmem?
Or in this situation buffers in highmem can't be used?

Nikita
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
email Follow the discussionReplies 2 repliesReplies Make a reply

Replies

#1 RKK
October 19th, 2011 - 06:30 am ET | Report spam
Hi Nikita

On Wed, Oct 19, 2011 at 12:15 PM, Nikita V. Youshchenko wrote:
Hello.

We are writing a driver for a custom PCI device that receives large amount
of data.

Device is capable of DMAing received data in 64k chunks.

We have been going to:
- use physically-continuous 64k-sized memory areas using alloc_pages() with
order=4,
- allocate large number of such areas on driver init,
- implement mmap() to map those all to userspace for zero-copy processing,
- use streaming DMA to actually receive data


May i know why u want to mmap to userspace instead of using a
device? performance is affected by a large amount if u use mmap
However I can't find a way to use streaming DMA for large highmem areas.
- pci_map_single() is for linear mapping and can't work with highmem
- pci_map_page() can work with highmem but is limited to one page
- pci_map_sg() is for s/g lists, not for single 64k blocks.

Is there a way to use streaming DMA with large memory areas located in
highmem?


I dont think DMA is available for highmem? Not sure though . never saw
a usecase for it.
Or in this situation buffers in highmem can't be used?






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

Similar topics