>-----Original Message----- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] On Behalf Of linux-os >Sent: Friday, March 25, 2005 1:19 PM >To: Linux kernel >Subject: mmap/munmap on linux-2.6.11 > >Memory gurus, > >We have an application where a driver allocates DMA-able memory. >This DMA-able memory is mmap()ed to user-space. To conserve >DMA memory only single pages are obtained using > __get_dma_pages(GFP_KERNEL, 1) (one page at a time). These >pages, that may be scattered all about, are mmap()ed into contiguous >user data-space. The DMA engine uses a scatter-list so we can >write DMA pages anywhere. They don't have to be contiguous. > >Here's a catch. It would be nice to release those DMA pages >when we don't need them. However, there doesn't appear to >be any way for driver code to know when munmap() has been >called and those DMA pages are available to be released. > >How do I know that munmap() has been called? It turns out >that if I release those pages before unmapping the user-mode, >the system will crash. Therefore this could be a DOS attack >if my driver ever allowed the DMA pages to be released.
munmap() should do the job for you and release those automatically. Aleks. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/