Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Linux - Kernel This forum is for all discussion relating to the Linux kernel.


  Search this Thread
Old 11-20-2012, 12:12 AM   #1
LQ Newbie
Registered: Nov 2012
Posts: 1

Rep: Reputation: Disabled
Cache invalidation

" Either flush or invalidate the cache lines corresponding to the buffer accessed by DMA and processor at strategic times "

What is the exact meaning of "invalidate the cache lines corresponding to the buffer accessed by DMA" in the above context.

Old 11-20-2012, 12:26 AM   #2
Senior Member
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,665

Rep: Reputation: 488Reputation: 488Reputation: 488Reputation: 488Reputation: 488
Flush the cache by rewriting it down with zeroes. Invalidate it by preventing another write into the mapped memory or diverting its contents to null.

You are talking of kernel events; and I don't know exactly what you are doing. At least I made a try to put you up and gain attention from the better helpers around rather than leave your post to age without reply.

Hope that helps. Good luck.
Old 11-20-2012, 07:27 AM   #3
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 9,078
Blog Entries: 4

Rep: Reputation: 3165Reputation: 3165Reputation: 3165Reputation: 3165Reputation: 3165Reputation: 3165Reputation: 3165Reputation: 3165Reputation: 3165Reputation: 3165Reputation: 3165
Actually, that's not quite right ... I think.

"The cache" refers to the on-chip cache lines that are part of the virtual-memory subsystem, used to avoid repeated reference to page and segment tables (which, of course, would triple the number of memory accesses and thereby bring the whole thing to a screeching plod). When you do something that affects segmentation, e.g. discarding stuff, changing page-table entries and so on, you must invalidate those parts of the CPU caches. (And all CPUs must do so.) There are established procedures and macros etc. for this. They must be followed precisely, so that your code is 100%-reliable on all processors, in actual conditions under heavy loads.

I don't momentarily recall if the CPU will attempt to cache content, but it would not surprise me. Suffice it to say that, anywhere a cache could be present, you must correctly advise the hardware when to invalidate it, and you must do so in the most specific (hence, least intrusive) way possible.

Last edited by sundialsvcs; 11-20-2012 at 07:31 AM.


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
How does slab coloring maximizes the use of Cache Lines or Cache Rows? pmehtal Linux - Kernel 7 01-06-2016 02:01 PM
LXer: Session Destroyer: Automatic Webapp Session Invalidation LXer Syndicated Linux News 0 12-31-2008 04:50 AM
openSUSE 10: Samba failed to create the cache directory in /var/cache mianmajidali Linux - Server 0 05-09-2008 02:00 AM
Error: Caching enabled and local cache: //var/cache/yum/base/primary.xml.gz does... dr_zayus69 Linux - Software 2 07-06-2005 04:32 AM > Forums > Linux Forums > Linux - Software > Linux - Kernel

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

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