Question

Is there any linux command to get the set of contiguous physical address spaces available. For my application, I need a large (100MB to 512MB) contiguous physical address space to test a kernel module. What would be the easiest way to get that information from the command prompt?

Was it helpful?

Solution

I don't know such command and don't think that such command exists.

If your needs are just testing, you may limit amount of RAM available to kernel by kernel mem= boot parameter. Rest of memory would be physical, continuous and available exclusively to you.

OTHER TIPS

In usermode, memtest86+ allocates and pins memory. Kernel is free to use MMU and map this single contiguous segment to several physical adress space areas.

/dev/hugetbl does similar, you get pages in smth like 4MB or 10MB, but actual backing for this pages may be discontiguous.

I don't think usermode access like this is justified.

Do check what xf86 project does -- video card drivers often require lots of memory :)

http://lwn.net/Articles/486301/ covered this subject from a different angle -- should you be able to expect large contiguous free blocks?

Perhaps you need to look at kernel level ops.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top