cache invalidate in user space

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Does anybody know how can I invalidate content of the cache in user
space = user process/thread? Thanks.


Re: cache invalidate in user space

Quoted text here. Click to load it

1) What architecture
2) Why (maybe there are better solutions)

JB

Re: cache invalidate in user space
PowerPC. Just D-cache. What I'm doing right now is that I fill dummy
buffer - which makes content of the D-cache filled by that dummy
buffer. But for future it slows down execution.


Re: cache invalidate in user space
Quoted text here. Click to load it

But why are you doing it ? It's hard to think of a good reason.

Re: cache invalidate in user space

Quoted text here. Click to load it

Hmmm. Why it slows down execution? The PowerPC has separate I cache. Or do
you work with a large amount of data? So the next steps are slowed down due
to flushing old d cache content?

With the PowerPC architecture you have a bunch of cache control instructions
also in userspace. See the architecture manual and search for instructions
like "dcbz" (very powerfull to zero out memory areas), "dcbf" to flush
specific address spaces (that is what you need) and "dcbt" to preload data
before using. With "dcbt" and "dcbf" in a loop you can handle a huge amount
of data in a very efficient way (flush n, touch n+2, modify n+1, loop with
n=n+1).

See the GNU libc string and memory functions in the PowerPC part how to use
these assembler instructions from "C" code...

Hope it helps.
Juergen



Re: cache invalidate in user space
     snipped-for-privacy@yahoo.com writes:
Quoted text here. Click to load it

Which architecture/processor?


Rob

Re: cache invalidate in user space

snipped-for-privacy@yahoo.com EC%9E91%EC84%B1:

Quoted text here. Click to load it

AFAIK it's almost impossible. I think you'd better write a small device
driver and use it to do the necessary job.


Site Timeline