On Tue, Jan 08, 2002 at 10:36:08AM +0200, guy keren wrote: > someone once told me of the following wish for a program - we allocate > small buffers that read data (from the network, for example). once we're > acknowledged that we got "enough data", we want to pass the entire > stream to a module that processes it. we want the data to be contiguous in > memory - so the processing code won't have to deal with a list of buffers. > modify_ldt can be used here.
hmm... that would be a neat (mis)use of segments, but it wouldn't be quite transparent - you would need to set up a desciptor per buffer (scatter gather entry), and then switch between descriptors (via a write to the segment registers) when switching to a different buffer. So the processing code would still need to know which segment to switch to - just following a pointer for the new buffer seems simpler to me. Also, this would be extremely non portable. > we never got to actually implementing it - but i do wonder if this is > feasible or not. With a kernel space helper, everything is feasible, including modifying the page tables, which is what you really want here. See for example remap_file_pages, which should do what you want, provided you use a file that has an in-memory backing store (e.g. resides on tmpfs), your buffers are page aligned, etc. http://lwn.net/Articles/24468/. I am entirely unconvinced however that the cost of the page table fiddling is worth it for simplifying the processing. Cheers, Muli -- Muli Ben-Yehuda http://www.mulix.org | http://mulix.livejournal.com/ ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
