Memory Half 2: CPU Caches
It ought to have been noted within the textual content that a lot of the description of multi-cache interplay is specific to x86 and equally "sequentially-constant" architectures. Most modern architectures will not be sequentially constant, and threaded packages should be extraordinarily careful about one thread depending on information written by one other thread becoming visible within the order in which it was written. Alpha, PPC, Itanium, and (sometimes) SPARC, however not x86, AMD, or MIPS. The consequence of the requirement to keep up sequential consistency is poor efficiency and/or horrifyingly advanced cache interaction machinery on machines with greater than (about) 4 CPUs, so we are able to count on to see extra non-x86 multi-core chips in use soon. I feel your criticism is misdirected. The textual content would not contact on memory consistency in any respect - it is solely out of its scope. Besides, you need a cache coherency protocol on any multi processor system. On the subject of memory consistency, there are different opinions.
Some time in the past there was a very attention-grabbing discussion in RealWorldTech the place Linus Torvalds made an interesting point that it may be argued that explicit memory limitations are more expensive than what the CPU has to do with the intention to create the illusion of sequential memory consistency, Memory Wave as a result of explicit MBs are by necessity extra basic and actually have stronger ensures. Sorry, not true. It describes how caches of various x86 CPUs work together, but would not say it only describes x86, falsely suggesting that's how each different machine does it too. It leaves the reasonable reader beneath the impression that programmers need not know anything about memory consistency. That is not fully true even on x86, however is simply false on most non-x86 platforms. If Ulrich is writing for people programming only x86, the article ought to say so with out quibbling. If not, Memory Wave App it should call out locations where it is describing x86-specific conduct. To the best of my information, the outline in the article applies to all cache coherent techniques, together with the ones listed in your earlier post.
It has nothing to do with Memory Wave consistency, which is an issue principally inner to the CPU. I'm very possibly unsuitable, of course - I'm not a hardware system designer - so I'm glad to debate it. Can you describe how the cache/memory behavior in an Alpha (for instance; or any other weak consistency system) differs from the article ? I agree that coding with Memory Wave App obstacles (and so on.!) is a giant topic, and beyond the scope of this installment. It could have sufficed, although, to mention that (and where) it is a matter for concern, and why. 86 and x86-64 really aren't sequentially-constant, because this is able to lead to an enormous efficiency hit. They implement "processor consistency" which implies loads can pass stores but no different reordering is allowed (except for some particular instructions). Or to place it another method, hundreds have an acquire barrier and stores have a launch barrier.
Implementations can situation masses to the bus out of order, however will invalidate early loads if needed to realize the same have an effect on as if all masses were executed so as. Explicit memory barrier directions may be vital or useful even on x86 and x86-64. But ideally programmers will use portable locking or lockless abstractions as a substitute. The concept of disabling hyperthreading (SMT) within the BIOS as a manner to cut back cache misses and presumably enhance efficiency is attention-grabbing (and pertinent to me as I run a system with such a CPU and motherboard). In spite of everything, my CPU appears to make the most of this feature about 10% of the time, and even then it's usually (99.99% of the time) with two distinct, non-threaded functions. It does seem logical that, if the hyperthreaded CPU exhibits as two CPUs to the OS (I get two penguins at boot time plus cat /proc/cpuinfo shows two processors), but each digital CPU is sharing the identical 512K of L2 cache, then perhaps my Laptop is sucking rocks in performance because of the cache miss rate alone.