DC PMM(内存模式)缓存​​一致性如何表现?

How does DC PMM (memory mode) cache coherence behave?

当前设置:
今天最新的英特尔架构具有非包容性 L3 缓存,其中每个切片 (+CHA) 都包含一个“探听过滤器”,其中包含 L3 目录在包容性情况下本应提供的位置信息(这种设计选择可能会避免采用一致性消息超过网状带宽)。大多数还默认启用“内存目录”,它可用于过滤远程侦听或以其他方式更改一致性事务的本地和远程部分的时间属性。 当访问属于不同套接字的内存位置时,RFO 直接发送到 QPI/UPI 环而不是 L3+CHA。内核复制 L3 维护的源地址解码器 (SAD) 寄存器,这些寄存器确定哪个 NUMA 节点负责物理地址。一旦 RFO 到达负责的归属代理,它决定是否必须将侦听发送给其他 sockets/cores 并响应呼叫者(可以并行执行此操作)。如果带宽可用,还有 OSB 让 L3 进行推测性监听。

“内存目录”是与 DRAM 中的缓存行数据一起定位的一个或多个位,指示另一个一致性域是否可能具有缓存行的修改副本。
这些位不会针对来自本地 cores/cache 的加载进行更新,因为 L3/CHA 会跟踪它。 在 M 状态缓存行的写回无效后,内存目录位被清除,因为只有一个 L3/CHA 可以使缓存行处于 M 状态。

英特尔直流 PMEM,
来自,Intel® 64 and IA-32 Architectures Optimization Reference Manual 第 2.1.31 节
(我想在内存模式下,虽然他们没有在本节中指定)

On systems with multiple processors, a directory is used for cache coherence. This directory is implemented as a distributed in-memory directory, with the coherence state of each cache line stored in metadata within the line itself in memory.
In cases where there are cores in different processors repeatedly reading the same set of lines in the Intel Optane DC Persistent Memory Module, there will be several writes to the Intel Optane DC Persistent Memory Module recording the change in the coherence state each time.

这表示 PMM 使用内存目录。

These writes are called “directory writes” and tend to be random in nature. As a result, several of these writes can lower the effective Intel Optane DC Persistent Memory Module bandwidth that is available to the application.

在类似的设置中,普通 DRAM 是否也会受到随机目录写入的影响?
或者在写入 b/w 为 48GB/s 而 PMM 只有 ~2.3GB/s (1) 的 DRAM 中无关紧要吗?

为什么 DRAM 'memory directory' 存在时 PMM 需要使用目录一致性协议?

Optane DC Persistent Memory Module may be accessed by different threads, and if these kind of patterns are observed, one option to consider is to change the coherence protocol for Intel Optane DC Persistent Memory Module regions from directory-based to snoop-based by disabling the directory system-wide.

对远程 PMM 的 RDMA 请求是否也需要通过远程 DRAM?

Most recent intel architectures today have non-inclusive L3 cache where each slice (+CHA)

自 Skylake 以来,具有服务器非核心设计的处理器在网状互连上具有非包容性 L3。 Tiger Lake (TGL) 是第一个具有客户端非核心设计的同构(仅限大内核)微架构,其中包括非包容性 L3。参见:Where data goes after Eviction from cache set in case of Intel Core i3/i7。但是CHA设计并没有在TGL中使用。

includes a "snoop filter" that contains the location information an L3 directory would have provided if it were inclusive

探听过滤器是一个目录。这两个术语指的是用于保存一致性信息的相同硬件结构。

When a memory location belonging to a different socket is accessed, the RFO is directly sent to the QPI/UPI ring

片上环形互连不符合 QPI 或 UPI 规范。这些互连实际上彼此有很大不同。片上互连和外部互连之间存在专用接口单元,可在消息格式之间进行转换。英特尔使用 QPI/UPI 作为芯片之间的链接。

When a memory location belonging to a different socket is accessed, the RFO is directly sent to the QPI/UPI ring and not L3+CHA.

你的意思是从核心访问?从一个核心到任何地址的所有类型的请求都通过一个缓存代理,它可以是与该核心或同一 NUMA 域中的另一个 CA 并置的代理。当 CA 收到请求时,它会将其发送到 SAD(位于 CA 内部)以确定哪个单元应为该请求提供服务。同时,根据请求的类型,它还会发送到关联的 L3 切片(如果存在并启用)进行查找。例如,如果请求是读取 E/F/S 状态(RdData)的数据缓存行,则并行执行 L3 查找操作。如果它是从遗留 I/O space 中读取的,则不执行任何查找。如果执行查找并且查找结果未命中,则使用 SAD 的输出来确定将请求发送到何处。

Once the RFO reaches the home agent responsible, it decides if snoops must be sent to other sockets/cores and respond back to the caller (can do this in parallel).

归属代理(或 CHA 的归属代理功能)不在本地发送侦听。在 L3 未命中后,假设家庭侦听模式,将发生以下情况:

  • 请求被发送到拥有该线路的本地代理,该代理最终将为该请求提供服务。
  • 如果线路所在的 NUMA 域与请求者所在的域不同,则会向拥有该线路的 CA 发送探听请求。
  • 向与请求者处于同一NUMA域中的每个IIO单元发送监听请求(因为每个IIO单元中都有缓存)。
  • 向主 NUMA 域中的每个 IIO 单元发送侦听请求。

然后 HA 检查目录缓存(如果支持和启用),如果错过,它检查内存中的目录(如果支持和启用),并根据结果向其他 NUMA 域发送侦听。

所有响应都由 HA 收集,然后 HA 最终发回所请求的行并更新目录。

我不知道你所说的“可以并行执行此操作”是什么意思。

The "memory directory" is one or more bits located with the cache line data in DRAM that indicate whether another coherence domain might have a modified copy of the cache line.

这不仅仅是跟踪修改后的副本,而是跟踪任何状态下行的存在。

请注意,我们在这里讨论的所有缓存代理都在同一个一致性域中。它只是一个相干域。我想你的意思是另一个 NUMA 节点。

Would normal DRAM also suffer from random directory writes in a similar setup?

是的。如果对目录的访问恰好太多并且不支持或禁用目录缓存,即使对于 DRAM,影响也可能很大。但 3D XPoint 中的影响要大得多,因为写入的行缓冲区局部性要低得多(即使在一般情况下,不仅仅是目录写入),而且 3D XPoint 的预充电时间比 DRAM 长得多。

Why does PMM need to use directory coherence protocol when the DRAM 'memory directory' exists?

无论是在 DRAM 还是 3D XPoint 中,一致性状态都与每一行一起存储。只需要一个事务来读取状态和行,而不是潜在的两个事务,因为所有目录都存储在 DRAM 中。我不确定哪种设计在性能方面更好以及提高了多少,但是用每一行存储状态肯定更简单。

Would RDMA requests to remote PMM need to go through remote DRAM as well?

我不明白这个问题。如果请求的地址映射到 PMM,您认为它为什么必须通过 DRAM?