LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Making a memory block as non cacheable by the processor (https://www.linuxquestions.org/questions/linux-newbie-8/making-a-memory-block-as-non-cacheable-by-the-processor-659668/)

Jason Souza 08-01-2008 01:54 AM

Making a memory block as non cacheable by the processor
 
Hi,

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.

Thanks!
Jason

taxtropel 08-01-2008 07:28 PM

you would have to modify the kernel.

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

See: http://www.oreilly.com/catalog/linux.../book/ch15.pdf

Search for cache.

Jason Souza 08-04-2008 01:10 AM

Hi,

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?

Thanks,
Jason

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

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

See: http://kernelnewbies.org/KernelMemoryAllocation


All times are GMT -5. The time now is 10:31 AM.