Skip to contentSkip to conversation

kmalloc/__get_free_pages and SHMLBA

DISCUSSION Jamie Iles 1 participant 1 message Jun 11, 2010

lore
Share & tools
lore

Jamie Iles

author
#0 lore raw

I'm writing a driver at the moment that mmap()'s a buffer into userspace and then performs DMA from the kernel buffer into the device. If I allocate with kmalloc()/__get_free_pages() is there anything that can be done to guarantee that the allocation is aligned to SHMLBA or do I need to try overallocating and do this myself?

The alternative is to use vmalloc_user() and use vmalloc_to_page() to get the direct mapping addresses to perform the DMA mapping but I'd like to be able to DMA the whole buffer without the need for scatterlists.

Jamie