I'm working on a loadable and had some questions about memory management.
One of the things I'd like to be able to do is allocate DMA buffers in the
kernel and remap those to user space. remap_page_range looks like it
provides the functionality I need, but of course only works on non-RAM
memory addresses and "reserved" pages.
Some code I've seen gets around this by twiddling with the "reserved" bit
in the pages, but this is of course a bad hack. I noticed that the bttv
driver calls mem_map_reserve() on the desired pages, and then has no
problem remapping the buffers into user space.
Is this the "Right" and "acceptable" way to go about doing this, or just
less of a hack?
I was also looking for a way to mark pages uncacheable. It didn't look
like there was any way to do this (nor other cache-related functionality,
such as flushing caches) on x86 architectures, but that there seemed to be
such things on other architectures (such as arm and m68k).
I realize MTRR functionality exists for marking cache behavior for ranges
of physical memory, but recent Intel processors provide Page Allocation
Table bits to allow fine-grained control at a page level. Would such code
likely be accepted into the kernel, or are there reasons for avoiding such
functionality?
Thanks,
Terence Ripperda
SGI
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/