LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 08-01-2008, 02:54 AM   #1
Jason Souza
LQ Newbie
 
Registered: Apr 2008
Posts: 3

Rep: Reputation: 1
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
 
Old 08-01-2008, 08:28 PM   #2
taxtropel
Member
 
Registered: Mar 2005
Location: Cascade Mountains WA USA
Distribution: Linux From Scratch (LFS)
Posts: 149

Rep: Reputation: 16
you would have to modify the kernel.
 
Old 08-01-2008, 08:50 PM   #3
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

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

Search for cache.
 
Old 08-04-2008, 02:10 AM   #4
Jason Souza
LQ Newbie
 
Registered: Apr 2008
Posts: 3

Original Poster
Rep: Reputation: 1
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
 
Old 08-04-2008, 04:11 AM   #5
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 59
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
 
  


Reply

Tags
kernel


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Configuring alien memory as Cacheable/ Non Cacheable linuxguy_72 Linux - Kernel 0 05-04-2007 02:25 AM
Memory and Processor question Drunkalot Debian 5 05-25-2006 10:27 AM
Processor/memory tuning. lgregg Linux - General 0 03-20-2006 03:14 PM
how to allocate non-cacheable buffer? mehuljv Programming 2 05-21-2005 02:08 AM
Processor Power vs Memory redir Linux - Hardware 13 05-21-2004 11:33 PM


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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration