-   Linux - Newbie (
-   -   Making a memory block as non cacheable by the processor (

Jason Souza 08-01-2008 02:54 AM

Making a memory block as non cacheable by the processor

Is there any way to make a block/page of memory uncacheable by the processor? The allocated memory area shall be used for DMA operations and we want this memory area NOT to be cached by the processor.

Is there any way I can do this? Currently I'm using get_free_pages() with GFP_DMA|GFP_KERNEL as the arguments.

I'm using montavista linux kernel version 2.4.20.


taxtropel 08-01-2008 08:28 PM

you would have to modify the kernel.

Mr. C. 08-01-2008 08:50 PM


Search for cache.

Jason Souza 08-04-2008 02:10 AM


Thanks for your replies. I tried modifying the kernel by opting to disable the D-Cache during configuration. The problem with this is that the kernel does not cache data at all and hence renders the system very slow.
What I would like to do is allocate a page of memory for DMA operation. If this specific page is cached by the kernel, then if any modification done in this memory area by the DMA controller will not be visible to the software since the software will read the older data cached by the processor. (The good old cache coherency problem). This is the reason why I would want to make the page uncacheable.

I went through chapter 15 of oreilly book but could not find a good method. Is there any way I can achieve this?


Mr. C. 08-04-2008 04:11 AM

You don't need to recompile the kernel to get uncached address space. Not many modern drivers would work well without it.


All times are GMT -5. The time now is 03:41 AM.