[LITMUS^RT] RFP: Jumbo Ring Buffers

Christopher Kenna cjk at cs.unc.edu
Tue Apr 23 08:44:10 CEST 2013


On Mon, Apr 22, 2013 at 10:30 PM, Björn Brandenburg <bbb at mpi-sws.org> wrote:
> What we need to do instead is to allocate physically non-contiguous memory and install page table entries to make it virtually contiguous, just like userspace memory.
>
> I don't think we need to "hack" anything; a proper allocator most likely exists already. We just need to figure out which it is and patch the code to use it.

I did something like this a while ago, but with fewer pages (smaller
areas of memory). In general, I built up an array of pointers to
`struct page`s that corresponded to the kernel virtual addresses of
pages that I owned, and then I used the vmap function to map the pages
(referenced from the array) into virtually contiguous kernel address
space. Here's vmap:
http://lxr.linux.no/linux+v3.8.8/mm/vmalloc.c#L1551

It looks like vm_map_ram is the newer function to use. This article I
found <http://lwn.net/Articles/304188/> mentions that up to 64 pages
can be mapped as of kernel 2.6.28, but it looks like this restriction
is lifted based on the branch in the function when mapping more than
VMAP_MAX_ALLOC pages. Here is vm_map_ram:
http://lxr.linux.no/linux+v3.8.8/mm/vmalloc.c#L1090

Hope this provides some ideas.

 -- Chris




More information about the litmus-dev mailing list