Discussion:
Allocate non-cacheable memory question
(too old to reply)
g***@gmail.com
2006-07-17 16:07:17 UTC
Permalink
Hi
Anyone know how to allocate a non-cacheable memory in UNIX (IRIX 6.5 to
be exact). I'm allocating some memory using malloc(), writing into it,
but it seems to be getting some cached data somewhere.
As always, appreciate any input.
Thanks.
Tony 'Nicoya' Mantler
2006-07-17 17:25:55 UTC
Permalink
In article <***@i42g2000cwa.googlegroups.com>,
***@gmail.com wrote:

: Hi
: Anyone know how to allocate a non-cacheable memory in UNIX (IRIX 6.5 to
: be exact). I'm allocating some memory using malloc(), writing into it,
: but it seems to be getting some cached data somewhere.
: As always, appreciate any input.

SGI systems are cache-coherent, so that shouldn't be your problem. How exactly
are you reading and writing this memory? Perhaps you're missing some
"volatile"s, or require some locking around shared accesses? Is this memory area
aliased (accessed via more than one pointer in the same function)?

If you were allocating via mmap() I would suggest that you need some calls to
msync(), but that doesn't seem to be the case.


Cheers - Tony 'Nicoya' Mantler :)
--
Tony 'Nicoya' Mantler - Master of Code-fu
-- ***@ubb.ca -- http://www.ubb.ca/ --
g***@gmail.com
2006-07-17 19:32:22 UTC
Permalink
Thanks Tony,

It turns out to be a hardware issue....but thanks for the time and
help.
Always appreciate it.
Post by Tony 'Nicoya' Mantler
: Hi
: Anyone know how to allocate a non-cacheable memory in UNIX (IRIX 6.5 to
: be exact). I'm allocating some memory using malloc(), writing into it,
: but it seems to be getting some cached data somewhere.
: As always, appreciate any input.
SGI systems are cache-coherent, so that shouldn't be your problem. How exactly
are you reading and writing this memory? Perhaps you're missing some
"volatile"s, or require some locking around shared accesses? Is this memory area
aliased (accessed via more than one pointer in the same function)?
If you were allocating via mmap() I would suggest that you need some calls to
msync(), but that doesn't seem to be the case.
Cheers - Tony 'Nicoya' Mantler :)
--
Tony 'Nicoya' Mantler - Master of Code-fu
Loading...