上篇介绍了read的操作类型,本篇我们来介绍一下dataless
目录
一、dataless操作概览
二、Non-CMO (Non-Cache Maintenance Operation)
1、CleanUnique
2、StashOnce and StashOnceSep
3、Evict
三、CMO (Cache Maintenance Operation)
一、dataless操作概览
名称(non-CMO) | 描述 |
CleanUnique | 对snoopable地址区域的请求,将Requester的cache line状态更改为“Unique”,以便对该cache line执行写操作。对其他的master的cache clean,并且invalid,其他cache line dirty的数据需要写入main memory |
MakeUnique | 同CleanUnique,但是dirty cacheline直接丢弃。 |
Evict | 用于告诉ICN,该RN-F不再缓存这个cacheline(类似于CPU知会HNF某一条cacheline已经被逐出了,本地已经没有了) |
StashOnceUnique, StashOnceSepUnique | 对snoopable地址区域的请求,以尝试将被寻址的cacheline移动到目标缓存,以使目标能够存储该行。被寻址的RN可以按照ReadUnique来处理 |
StashOnceShared, StashOnceSepShared. | 同上,被寻址的RN可以按照ReadNotSharedDirty 来处理 |
名称 (CMO) | 描述 |
CleanShared | 对snoopable地址区域的请求,所有缓存副本都更改为非dirty状态,并且任何dirty的副本都会写回main memory |
CleanSharedPersist | 同上,但是dirty数据写入PoP(Point of Persistence ). PoP是内存系统中的一个点,当系统电源断开时,会保持对内存的写入,当电源恢复时,会可靠的恢复对内存的写入 |
CleanSharedPersistSep | 同上,但是对requester需要有2个response,Comp response 表示请求到达HN;Persist response表示请求已到达PoP |
CleanInvalid | requester为I态时才能发此请求, 将拥有此 cacheline的 副本invalidate,dirty的写回main memory |
MakeInvalid | 同上,dirty的丢弃 |
CleanSharedPersistSep 的功能与leanSharedPersist 类似,但需要对请求者进行两个单独的响应:
1、Comp 响应,表明请求已达到一致性点(PoC),并且可以在请求者处消除危险。
2、持久响应,表明请求已到达PoP 或最终目的地。
PoC (Point of Coherence) : A point at which all agents that can access memory are guaranteed to see the same copy of a memory location. In a typical CHI based system it is the HN-F in the interconnect.
保证所有可以访问内存的代理都能看到内存位置的相同副本的点。 在典型的基于 CHI 的系统中,它是互连中的 HN-F。
Dataless transaction可分为Non-CMO (Non-Cache Maintenance Operation) 和 CMO (Cache Maintenance Operation)
第一个表为non-CMO的操作,第二个表为CMO操作
二、Non-CMO (Non-Cache Maintenance Operation)
支持的操作有:
• CleanUnique.
• MakeUnique.
• Evict.
• StashOnceUnique, StashOnceSepUnique.
• StashOnceShared, StashOnceSepShared.
步骤如下:
1、The Requester sends a Snoopable Read request on the REQ channel
2、The Completer returns the read data and any associated transaction response with the CompData opcode on the RDAT channel
3、Requester must return an acknowledgement, using the CompAck opcode on the SRSP channel to indicate that the transaction has completed.
non-CMO的操作本文会举3个例子:CleanUnique、StashOnceShared、Evict
1、CleanUnique
CleanUnique : CleanUnique是将其他的master的cache clean,并且invalid,只保留当前master的cache(此cache可以是clean,也可以是dirty); 其他cache line dirty的数据需要写入main memory
1、RN-F1 has the cache line in SD state and responds to the snoop with a snoop response with data and PD asserted.
2、HN-F waits for all snoop responses and then sends a Comp_UC response to the Requester.
3、HN-F sends a Write request to update memory with the data received from RN-F1.
SnpRespData_I_PD后缀为PD,PD ( pass dirty ) ,表示更新内存的责任已传递给请求者或 ICN。只能为带有数据的 Snoop 响应声明 Pass Dirty。
Comp_UC : CleanUnique、 MakeUnique的comp response
MakeUnique相比cleanunique,没有写入main memory的操作,且不管其他cacheline的状态,dirtys数据会丢弃
2、StashOnce and StashOnceSep
Cache stashing机制可将数据存在系统中特定cache中,确保data靠近使用的节点,因此可以提高系统性能。Cache stashing只支持Snoopable memory空间。
相关的操作有:
• StashOnceUnique,
• StashOnceSepUnique.
• StashOnceShared,
• StashOnceSepShared.
步骤如下:
1、RN在REQ channnel发送request
2、ICN返回 comp response
3、如果是StashOnceSep request,Home返回StashDone响应,表示request已经被保序
4、Home还可以选择是否在SNP channel上snoop 目标RN-F
5、目标RN-F发送SnpResp响应,可以选择是否包含DataPull( DataPull =0b001表示响应包含读请求)
6、如果DataPull =0b001,则Home发送CompData响应
7、目标RN-F收到CompData后,返回CompAck
Datapull[2:0]==0b001 : Inclusion of Data Pull in the Snoop response(在 Snoop 响应中包含数据拉取)
Data Pull. Indicates the inclusion of an implied Read request in the Data response. (数据拉取。 指示在数据响应中包含隐含的读取请求)
DataPull只能等于0b000、0b001
Comp : Completer接受已经请求,并且不会发送RetryAck相应
StashDone : 后续对于同一内存位置的transaction,该transaction是可被观察到的(保序)
StashOnce的四种操作的区别在于:
• Sends StashOnce∗Unique to Home if the stashed cache line is to be modified.
如果要修改stash的缓存行,则将 StashOnce*Unique 发送到 Home。
• Sends StashOnce∗Shared to Home if the stashed cache line is not to be modified.
如果不修改stash的缓存行,则将StashOnce*Shared 发送到Home。
• Sends StashOnceSep only if the Requester is capable of handling the StashDone response.
仅当请求者能够处理StashDone 响应时才发送StashOnceSep。
• The StashOnce∗ requests provide a Stash target when the data is to be stashed in a peer cache.
当数据要存储在对等缓存中时,StashOnce* 请求提供存储目标。
• The StashOnce∗ requests do not provide a Stash target when the data is to be allocated to the next level cache.
当数据要分配到下一级缓存时,StashOnce* 请求不提供Stash 目标。
以StashOnceShared为例
1、RN sends a StashOnceShared request to HN-F with the Stash target identified as RN-F1.
2、HN-F sends a Comp response after establishing processing order for the received request that is guaranteeing the request is processed before a request to the same address
此响应是为了保序(该处理request要优先于后续任何request对该地址的请求)
3、HN-F sends a SnpStashShared snoop to RN-F1, and a ReadNoSnp request to SN-F to fetch Data.
4、RN-F1 sends SnpResp_I_Read response to HN-F.
5、HN-F treats the Read request from RN-F1 as a ReadNotSharedDirty, and sends a combined CompData to RN-F1.
6、 RN-F1 sends CompAck to HN-F to complete the Read transaction.
该操作的目的是,将SN中指定地址的数据,搬到RN-F1。但是在搬运前,要先对RN-F1进行snoop,判断RN-F1是否已经具有该数据
Snpresp_i_Read, 表示当前state是invalid的,同时带有read操作,要pull data;
SnpStashShared
Snoop request recommending that the Snoopee obtains a copy of the cache line in a Shared state:
• Permitted to be sent to only one RN-F. 只能发送给RN-F
• This specification recommends not sending the snoop if the cache line is cached at the target. 如果cache line就在target中,则建议不发送snoop
• The Snoopee must not return data with the Snoop response. 该snoop不能返回数据
• Permits the Snoop response to include a Data Pull. 该snoop的response允许包含Data Pull
• Must not change the cache line state at the Snoopee. 不能改变被snoop的cache line状态
The responses that include Data Pull are:
SnpResp_I_Read.
SnpRespData_I_Read.
SnpRespData_I_PD_Read.
SnpRespDataPtl_I_PD_Read.
3、Evict
告诉HN, 当前RN中的这条cacheline不再进行缓存;类似于CPU知会HNF某一条cacheline已经被逐出了,本地已经没有了;
RN在发送请求之前,会先将状态调整到 I
Evict
--告诉HN, 当前RN中的这条cacheline不再进行缓存;
--类似于CPU知会HNF某一条cacheline已经被逐出了,本地已经没有了;
--RN在发送之前,会先将状态调整到I;
三、CMO (Cache Maintenance Operation)
支持的操作有:
• CleanShared.
• CleanSharedPersist.
• CleanSharedPersistSep.
• CleanInvalid. • MakeInvalid.
步骤如下:
1、The Requester sends a request on the REQ channel
2、The Completer returns a Comp response on the CRSP channel.
3、For the CleanSharedPersistSep transaction the Completer also returns a Persist response to the Requester. The Completer is permitted to combine the Comp and Persist responses into a single CompPersist response.
以CleanSharedPersistSep为例:
要求所有CPU把dirty数据都写回主存
In this example of CleanSharedPersistSep transaction flow, the Point of Persistence (PoP) is at the SN-F.
1、RN-F1 has the cache line in SC state. RN-F1 responds to the snoop with a snoop response without data.
2、HN-F waits for all snoop responses and then sends a Comp_SC response to the Requester.
3、HN-F sends a CleanSharedPersistSep request to SN-F, only after completing the writing back of all snooped Dirty data, if any, to the SN-F. SN-F responds to the request with Comp
4、SNF sends a Persist response to RN-F0 to indicate that the request has reached the PoP, and data from any prior writes to the same location is pushed to the PoP
PoP (Point of Persistence) : 系统中用于持久性存储的特定位置或机制。它表示数据在系统中的存储状态,以确保数据在断电或重启后仍然可用。通常是将易失性存储(如cache)复制到非易失性存储(如硬盘)
图中,Comp_UC反映了其他master中该cache line的状态
Comp_UC:
1、表明该cache line副本在Requester中至高可以为UC状态(即可以是UC、UCE、SC、I)。
2、不过MakeReadUnique/CleanUnique这两个“Upgrade”的请求则有所差异,SD收到Comp_UC后进入UD状态。这在下文关于MakeReadUnique的描述中可以再次看到。
相应的response还有:
Comp_I:
表明该cache line副本在Requester中最终需为I状态。
Comp_SC:
表明该cache line副本在Requester中至高可以为SC状态(即可以是SC、I)。
Comp_UD_PD:
表明将更新Memory的责任传递给Requester,该cache line副本在Requester中至高可以为UD状态(即可以是UD、SD)。
对于CleanShared,可能会收到Comp_UC、Comp_SC、Comp_I。CleanShared用于将其他副本的dirty数据写回,并不会无效化其他副本,所以收到response后缓存行状态不改变。
对于CleanUnique,只会收到Comp_UC。收到时处于I状态(出现I状态的原因是发出CleanUnique后被invalid),则进入UCE;收到时处于SC状态,则进入UC状态;收到时处于SD,则进入UD状态。
对于MakeUnique,只会收到Comp_UC。由于其写一整行,所以最终进入UD状态。