hi Fabrice, i have succesfully used the 2.2.14 kernel to transfer all of 100 Mbps sniffed traffic from a network. i remapped a kernel memory region to user space (vmalloced memmory) and used it to copy data(but still the skbuff copy was not eliminated, which i suppose is another added advantage in ur kiobuf model). then i used a 1 Gb file cache to store the data and process at a slow speed. this sure is lousy, but is working fine for me ;-). so i think this mmap based approach should work fine for 100 Mbps, or equivalent other wired data. hope it helped ;-) Mohan S --- Fabrice Tchakountio <ftchakou@ftchakountio.bbn.com> wrote: > Hi Stuart - > > Thanks for your excellent suggestion. I have a > couple of comments. > > * How can we deal with potentially large chunks of > memory: > I thought we need vmalloc() to allocate large > kernel chunks (e.g: > >= 10 MB) > > * I'm concerned about memory limitations since the > data > is still wired: > > you're suggesting a mmap-based approach with the > user having the > possibility to free up the memory with a close() > call. > > In our application, we intend to store each > transferred chunk from the > kernel in a ring buffer. Thus there is a potential > risk to consume all > the main memory with a mmap-based approach since > the data is still > wired. > > Ideas ? > > Thanks > > > > > > > > > > > > On Thu, 4 Oct 2001, Stuart Macdonald wrote: > > > Hi, > > > > The following works for me: > > > > 1) User space calls kernel-based function which: > > > > a) creates a Virtual Memory Area of say > 64KB. do_mmap_pgoff() > > returning address and then call find_vma() to > get the actual vma. > > > > b) does a pvKernelMem = > __get_free_pages(up to 128KB I believe) to > > allocate contiguous kernel pages. Note, > kmalloc() does not always > > end up being page-aligned. Save pvKernelMem for > kernel access to shared > > memory. > > > > c) Map the user VMA to the kernel pages > using: set_page_reserved() > > on all pages then remap_page_range(). > > > > d) return VMA->vm_start to the user to > denote the beginning address > > of the shared memory. > > > > 2) Use memory. Suggest you specify "volatile" on > variables utilizing such > > shared memory to avoid compiler > optimization related > > issues. > > > > 3) Have a "Close" function unmap by using > do_munmap() and free kernel pages. > > > > > > Stuart > > > > > > - > Kernelnewbies: Help each other learn about the Linux > kernel. > Archive: > http://mail.nl.linux.org/kernelnewbies/ > IRC Channel: irc.openprojects.net / #kernelnewbies > Web Page: http://www.kernelnewbies.org/ __________________________________________________ Do You Yahoo!? NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 - Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ IRC Channel: irc.openprojects.net / #kernelnewbies Web Page: http://www.kernelnewbies.org/