Memory barriers and the TLB

后端 未结 1 1815
暖寄归人
暖寄归人 2021-01-31 09:13

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

相关标签:
1条回答
  • 2021-01-31 09:54

    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?

    0 讨论(0)
提交回复
热议问题