Reputation: 11
Can memory address be loaded in a cache but not in the main memory? In other words, if cache wants to write data into the main memory, can that generate page fault in x86-64 with Linux?
Upvotes: 1
Views: 151
Reputation: 365677
No, cache is transparent (and in x86-64 caches by physical address). Only load or store instructions (and code-fetch) can page fault, and that happens synchronously (on the offending instruction), not some random time later.
Of course, actual commit to L1d cache is delayed (by the store buffer) until after retirement from the out-of-order execution back-end. But checking for faults is done in the load/store execution unit (which for stores, writes data and address into the store buffer for it to definitely happen and become visible some time later.)
Upvotes: 3