intel_i830_chipset_flush(): local clflush() vs. global wbinvd()
Eric, Brice,
what is the point of issuing wbinvd() on all CPUs here if clflush isn't available, but using clflush() (if available) only on the current CPU?
Thanks, Jan
Quoted 4 lines · Jan Beulich
Eric, Brice,
what is the point of issuing
wbinvd()on all CPUs here if clflush isn't available, but usingclflush()(if available) only on the current CPU?
From the IA-32 architecture manuals:
WBINVD: "Writes back all modified cache lines in the processor’s
internal cache to main memory and invalidates (flushes) the internal caches. The instruction then issues a special- function bus cycle that directs external caches to also write back modified data and another bus cycle to indicate that the external caches should be invalidated.
CLFLUSH: "Invalidates the cache line that contains the linear address
specified with the source operand from all levels of the processor cache hierarchy (data and instruction). The invalidation is broadcast throughout the cache coherence domain. If, at any level of the cache hierarchy, the line is inconsistent with memory (dirty) it is written to memory before invalidation. The source operand is a byte memory location.
My reading of these two is that wbinvd affects this processor's cache lines, while clflush affects the cacheline regardless of which CPU owns it since they all share the same coherence domain.
Given that on many systems without CLFLUSH (8xx chipsets), we have issues with getting coherence to external memory successfully (note how neither of those instructions provide that!), I'm not sure it's a good time to be worrying about how to improve cache flushing performance on them!
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Eric Anholt <[email protected]> 28.04.10 01:00 >>>
Quoted 4 lines · Jan Beulich
Eric, Brice,
what is the point of issuing
wbinvd()on all CPUs here if clflush isn't available, but usingclflush()(if available) only on the current CPU?My reading of these two is that wbinvd affects this processor's cache lines, while clflush affects the cacheline regardless of which CPU owns it since they all share the same coherence domain.
Indeed, one can read it that way, although it seems unlikely to me that it really means it (namely in large configurations the need to behave that way may make clflush less preferable over wbinvd in some situations). I'm trying to clarify this with Intel.
Quoted 4 lines
Given that on many systems without CLFLUSH (8xx chipsets), we have issues with getting coherence to external memory successfully (note how neither of those instructions provide that!), I'm not sure it's a good time to be worrying about how to improve cache flushing performance on them!
No, the purpose of the question was not to hint at elimination of the global wbinvd (which nevertheless could be reduced in scope), but rather to find out why the same isn't needed on the clflush path.
Jan