棋子 · 2020年01月20日

How to understand Exclusive

The purpose of Exclusive Access is to read, calculate and modify a cache line atomically. The built-in Atomic Transactions can do some basic calculations at ICN or SN, but if more complex operations are necessary, Exclusive Access is needed.

CHI specification rules that during an Exclusive Transaction to a snoopable region, when the addressed location is updated by other Logical Processor(LP), or is targeted by an Exclusive Store from another LP that is permitted to proceed, this Exclusive Transaction must fail.

So whats the difference between these two conditions? One Exclusive Access being interrupted by another Exclusive Access should fail the former one, essentially because the addressed location is updated by the latter one and the transaction is not atomic any longer. Isn't this one special case of the first condition that the targeted memory is updated?

1 个回答 得票排序 · 时间排序
极术小姐姐 · 2020年01月20日

The first case is simply making it explicit that any invalidating requests must cause the the exclusive monitor to be reset. This is the less expected case, as generally you wouldn't expect masters to be using the same region of memory for exclusives and non-exclusives.

The second case is the more expected case. Two masters are attempting to perform an exclusive store to the same region. If one master succeeds, then the other is guaranteed to fail and must restart its exclusive sequence. In almost all cases, this will be the first store exclusive that reaches the PoC monitor. In the second case, the failing exclusive does not update the memory location, and any associated snoops would not be broadcast.

你的回答