Memory barriers guarantee that the data cache will be consistent. However, does it guarantee that the TLB will be consistent?
I am seeing a problem where the JVM (java 7
The mapping is done via mmap64 (FileChannel.map). When the address is accessed there will be a page fault and the kernel shall read/write there for you. TLB doesn't need to be updated during mmap.
TLB (of all cpus) is unvalidated during munmap which is handled by the finalization of the MappedByteBuffer, hence munmap is costly.
Mapping involves a lot synchronization so the address value shall not be corrupted.
Any chance you try fancy stuff via Unsafe?