Memory Consistency
Cache coherence is not enough
Cache密致性主要关心不同处理器上执行的,对同一个内存位置的读写操作的顺序。而我们有时候希望内存系统,能保证对不同内存位置的读写操作的顺序。
(Goodman)
Processor Consistency: A multiprocessor is said to be processor consistency if the result of any execution is the same as if the operations of each individual processor appear in the sequential order specified by its program。
(Gharachorloo)
- 在任一取数操作LOAD允许执行之前,所有在同一处理机中先于这一LOAD的取数操作都以完成;
- 在任一存数操作STORE允许执行之前,所有在同一处理机中先于这一STORE的访存操作(包括取数操作和存数操作)都已完成。
在处理机一致性模型中,每个处理机内的W→R访存次序是可以违反的,从而使得一些读操作得以绕过以前的写操作先被执行,在不破坏正确性的前提下提高系统的性能。最近的研究结果表明,处理机一致性模型下的程序的性能比在顺序一致性下要高出大约30%。
Release Consistency: Spinlock in Linux