Hardware Solutions CACHE COHERENCE AND THE MESI PROTOCOL
COMPUTER ORGANIZATION AND ARCHITECTURE DESIGNING FOR PERFORMANCE NINTH EDITION
Hardware-based solutions are generally referred to as cache coherence protocols.
These solutions provide dynamic recognition at run time of potential inconsistency
conditions. Because the problem is only dealt with when it actually arises, there
is more effective use of caches, leading to improved performance over a software
approach. In addition, these approaches are transparent to the programmer and the
compiler, reducing the software development burden.
Hardware schemes differ in a number of particulars, including where the state
information about data lines is held, how that information is organized, where coher-
ence is enforced, and the enforcement mechanisms. In general, hardware schemes
can be divided into two categories: directory protocols and snoopy protocols.
DIRECTORY PROTOCOLS Directory protocols collect and maintain information
about where copies of lines reside. Typically, there is a centralized controller that is
part of the main memory controller, and a directory that is stored in main memory.
The directory contains global state information about the contents of the various
local caches. When an individual cache controller makes a request, the centralized
controller checks and issues necessary commands for data transfer between
memory and caches or between caches. It is also responsible for keeping the state
information up to date; therefore, every local action that can affect the global state
of a line must be reported to the central controller.
Typically, the controller maintains information about which processors have
a copy of which lines. Before a processor can write to a local copy of a line, it
must request exclusive access to the line from the controller. Before granting this
exclusive access, the controller sends a message to all processors with a cached
copy of this line, forcing each processor to invalidate its copy. After receiving
acknowledgments back from each such processor, the controller grants exclusive
access to the requesting processor. When another processor tries to read a line
that is exclusively granted to another processor, it will send a miss notification
to the controller. The controller then issues a command to the processor hold-
ing that line that requires the processor to do a write back to main memory. The
line may now be shared for reading by the original processor and the requesting
processor.
Directory schemes suffer from the drawbacks of a central bottleneck and the
overhead of communication between the various cache controllers and the central
controller. However, they are effective in large-scale systems that involve multiple
buses or some other complex interconnection scheme.
SNOOPY PROTOCOLS Snoopy protocols distribute the responsibility for
maintaining cache coherence among all of the cache controllers in a multiprocessor.
A cache must recognize when a line that it holds is shared with other caches.
When an update action is performed on a shared cache line, it must be announced
to all other caches by a broadcast mechanism. Each cache controller is able to
“snoop” on the network to observe these broadcasted notifications, and react
accordingly.
Snoopy protocols are ideally suited to a bus-based multiprocessor, because
the shared bus provides a simple means for broadcasting and snooping. However,
because one of the objectives of the use of local caches is to avoid bus accesses, care
must be taken that the increased bus traffic required for broadcasting and snooping
does not cancel out the gains from the use of local caches.
Two basic approaches to the snoopy protocol have been explored: write inval-
idate and write update (or write broadcast). With a write-invalidate protocol, there
can be multiple readers but only one writer at a time. Initially, a line may be shared
among several caches for reading purposes. When one of the caches wants to per-
form a write to the line, it first issues a notice that invalidates that line in the other
caches, making the line exclusive to the writing cache. Once the line is exclusive, the
owning processor can make cheap local writes until some other processor requires
the same line.
With a write-update protocol, there can be multiple writers as well as multiple
readers. When a processor wishes to update a shared line, the word to be updated is
distributed to all others, and caches containing that line can update it.
Neither of these two approaches is superior to the other under all circum-
stances. Performance depends on the number of local caches and the pattern of
memory reads and writes. Some systems implement adaptive protocols that employ
both write-invalidate and write-update mechanisms.
The write-invalidate approach is the most widely used in commercial multi-
processor systems, such as the Pentium 4 and Power PC. It marks the state of every
cache line (using two extra bits in the cache tag) as modified, exclusive, shared, or
invalid. For this reason, the write-invalidate protocol is called MESI. In the remain-
der of this section, we will look at its use among local caches across a multiproces-
sor. For simplicity in the presentation, we do not examine the mechanisms involved
in coordinating among both level 1 and level 2 locally as well as at the same time
coordinating across the distributed multiprocessor. This would not add any new
principles but would greatly complicate the discussion.
Hardware Solutions CACHE COHERENCE AND THE MESI PROTOCOL的更多相关文章
- Software Solutions CACHE COHERENCE AND THE MESI PROTOCOL
COMPUTER ORGANIZATION AND ARCHITECTURE DESIGNING FOR PERFORMANCE NINTH EDITION Software cache cohere ...
- CACHE COHERENCE AND THE MESI PROTOCOL
COMPUTER ORGANIZATION AND ARCHITECTURE DESIGNING FOR PERFORMANCE NINTH EDITION In contemporary multi ...
- Cache coherence protocol
A cache coherence protocol facilitates a distributed cache coherency conflict resolution in a multi- ...
- The MESI Protocol
COMPUTER ORGANIZATION AND ARCHITECTURE DESIGNING FOR PERFORMANCE NINTH EDITION To provide cache cons ...
- Multiprocessing system employing pending tags to maintain cache coherence
A pending tag system and method to maintain data coherence in a processing node during pending trans ...
- 计算机系统结构总结_Multiprocessor & cache coherence
Textbook:<计算机组成与设计——硬件/软件接口> HI<计算机体系结构——量化研究方法> QR 最后一节来看看如何实现parallelism 在多处 ...
- 《大话处理器》Cache一致性协议之MESI (转)
原文链接:http://blog.csdn.net/muxiqingyang/article/details/6615199 Cache一致性协议之MESI 处理器上有一套完整的协议,来保证Cache ...
- Cache一致性协议之MESI
http://blog.csdn.net/muxiqingyang/article/details/6615199 Cache一致性协议之MESI 处理器上有一套完整的协议,来保证Cache一致性.比 ...
- 《大话处理器》Cache一致性协议之MESI【转】
转自:https://blog.csdn.net/muxiqingyang/article/details/6615199 版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载 ...
随机推荐
- %格式化和format格式化--python
格式符 %[(name)][floags][width].[precision]typecode (name) 可选,用于选择指定的key flags 可选,可提供的值有: · + 右对齐,整数前加正 ...
- jstl param url redirect import
import标签 import标签用来导入其他页面 属性: * url :引入页面的路径 * context :工程名 * var :将引入的页面保存到一个变量中 * scope :保存到一个作用域中 ...
- Qt:postEvent 与 customEvent() 函数 进行异步通信; 以及参数的传递 // 防止界面卡死;;
class ColorChangeEvent : public QCustomEvent { public: ColorChangeEvent( QColor color ) : QCustomEve ...
- (iOS逆向工程)class-dump 安装与使用
class-dump,是可以把OC运行时的声明的信息导出来的工具.说白了,就是可以导出.h文件.用class-dump可以把未经加密的app的头文件导出来.废话不多说.class-dump的下载地址是 ...
- GitHub团队项目合作流程
已在另一篇博客中写出关于以下问题的解决,点此进入: 同步团队项目到本地时出现冲突怎么办? 项目负责人merge一个Pull Request后发现有错怎么回退? 目录: 零.前期准备 一.创建开发分支 ...
- Git TortoiseGit SSH设置
Git TortoiseGit SSH设置 http://www.cnblogs.com/ChenRihe/p/Git_TortoiseGit_SSH.html TortoiseGit默认的SSH客户 ...
- Ubuntu下Sublime Text 3解决无法输入中文的方法
Ubuntu下Sublime Text 3解决无法输入中文的方法_百度经验http://jingyan.baidu.com/article/f3ad7d0ff8731609c3345b3b.html ...
- Java中分割字符串
java.lang.String 的 split() 方法, JDK 1.4 or later public String[] split(String regex,int limit) 示例代码 p ...
- Theano在windows下的安装及GPU加速
安装环境:wondows 64bit Teano安装测试 1. Anaconda 安装 Anaconda是一个科学计算环境,自带的包管理器conda很强大.之所以选择它是因为它内置了python,以及 ...
- 使用FP-Growth算法高效发现频繁项集【zz】
FP树构造 FP Growth算法利用了巧妙的数据结构,大大降低了Aproir挖掘算法的代价,他不需要不断得生成候选项目队列和不断得扫描整个数据库进行比对.为了达到这样的效果,它采用了一种简洁的数据结 ...