Changes

Jump to: navigation, search

GPU621/False Sharing

79 bytes added, 17:26, 26 November 2021
Analyzing False Sharing
The answer is we need cache coherence. '''Cache coherence''' is defined as the '''uniformity of shared resource data that ends up stored in multiple local caches'''. In other words, we must keep all the local caches synchronized. The challenge of doing so is known as the Cache Coherence Problem. To solve this problem, multi-processor systems rely on cache coherence protocols to manage and maintain the cache.
<br><br><br><br><br><br>
== False Sharing ==
=== What is False Sharing? ===
Now that we understand the basics of a cache, how does this relate to the concept of false sharing?[[File:CPUCacheline.png|thumb|400px]]
False sharing occurs when multiple processors modify data that resides on the same cache line. When this data is written back to memory, the shared cache lines are marked as invalid or dirty. Processors must fetch an updated copy introducing significant delays due to memory access speeds. As you increase the number of processors, this quickly spirals out of control as there is an increasing chance the cache line is invalid.
The key thing to note is that you do not need to modify the same piece of data. If the modified data happens to belong to the same cache line, the cache will be invalidated, forcing a memory update to maintain cache coherency.
<br><br><br><br>
=== Example ===
83
edits

Navigation menu