Suppose that a cache line with variable X is simultaneously uploaded to L1d of CPU0 and L1d of CPU1. After changing the value of X from CPU0, when CPU1's L1d cache line is invalidated, Is it impossible for CPU1 to copy the variable X from CPU0's L1d cache if CPU0 has a cache line with X? And even if this is not the case, I want to know if there are cases where CPU0 brings in CPU1'
Invalidation of the cache from L1 cache
689 views Asked by whitebear AtThere are 2 answers
Peter Cordes
On
How would you copy from an L1 whose copy has been invalidated? It no longer has a copy of the line.
But anyway, pretty sure the first place that gets checked after an L1d miss is the local L2, then shared L3.
On a Skylake-server or later (thus non-inclusive L3), I think an L3 miss would get reloaded from DRAM, unless the line was in Modified state in another core.
Otherwise, on client chips and earlier Xeons, an L3 miss is impossible if any core has a valid copy, because it's inclusive. (Really old chips, before Nehalem, also didn't have inclusive last-level cache, e.g. Core2's L2)
See also Which cache mapping technique is used in intel core i7 processor?
When you say "If we invalidate the cache in one core", I'm not sure if you just mean having it evicted from that cache, e.g. to make room for something else, or if you mean running an instruction like clflush. Or if you mean that core did a store and thus had to do a Read For Ownership (RFO) to get MESI exclusive ownership of the line (i.e. invalidate all other copies) so it can commit a store from the store buffer to L1d.
Related Questions in X86
- How to call a C language function from x86 assembly code?
- the difference between two style of inline ASM
- Understanding the differences between mov and lea instructions in x86 assembly
- ARM Assembly code is not executing in Vitis IDE
- x86 - compare numbers and push the result onto the stack
- Seeking for the the method for adding the DL (data register) value to DX register
- link.exe unresolved external symbol _mainCRTStartup
- x86 Wrote a boot loader that prints a message to the screen but the characters are completely different to what I expected
- How does CPU tell between MMIO(Memory Mapped IO) and normal memory access in x86 architecture
- Why do register arg values need to be re-assigned in NASM after an int 0x80 system call?
- Why does LLVM-MCA measure an execution stall?
- Why does shr eax, 32 not do anything?
- Evaluating this in Assembly (A % B) % (C % D)
- Understanding throughput of simd sum implementation x86
- Making portable execution errors
Related Questions in INTEL
- What is the parameter for CLI YOLOv8 predict to use Intel GPU?
- Optimizing Memory-Bound Loop with Indirect Prefetching
- How can I set an uncommon screen resolution on GNU/Linux with an Arc 380 GPU and X11?
- How does CPU tell between MMIO(Memory Mapped IO) and normal memory access in x86 architecture
- Using CUDA with an intel gpu
- Having issue with CPU boosting on AMD
- Do all OpenCL drivers come with the IntelOneAPI compiler
- CL_DEVICE_NOT_AVAILABLE using Intel(R)Xeon(R)Gold 6240 CPU
- Can I launch a SGX enclave without Internet?
- Intel OneApi Vtune profiler not supporting my microarchitecture
- ModuleNotFoundError: No module named 'intel_extension_for_pytorch'
- What is the microcode scoreboard?
- Why does the assembly after my sys_clone call affect the cloned process?
- Why does mov fail to set dynamic section sizes when used on a function using GCC
- weird error happened when ran fpga program
Related Questions in CPU-ARCHITECTURE
- What is causing the store latency in this program?
- what's the difference between "nn layout" and "nt layout"
- Will a processor with such a defect work?
- How do i find number of Cycles of a processor?
- Why does LLVM-MCA measure an execution stall?
- Can out-of-order execution of CPU affect the order of new operator in C++?
- running SPEC in gem5 using the SimPoint methodology
- Why don't x86-64 (or other architectures) implement division by 10?
- warn: MOVNTDQ: Ignoring non-temporal hint, modeling as cacheable!, While simulating x86 with spec2006 benchamrks I am getting stuck in warn message
- arithmetic intensity of zgemv versus dgemv/sgemv?
- What is the microcode scoreboard?
- Why don't x86/ARM CPU just stop speculation for indirect branches when hardware prediction is not available?
- Question about the behaviour of registers
- How to increase throughput of random memory reads/writes on multi-GB buffers?
- RISVC Single Cycle Processor Data Path and Testbench
Related Questions in CPU-CACHE
- How CPUs Use the LOCK Prefix to Implement Cache Locking and ensure memory consistency
- How to check whether the PCIe Memory-mapped BAR region is cacheable or uncacheable
- Are RISC-V SH and SB instructions allowed to communicate with the cache?
- for remote socket cache-to-cache data transfer, why data homed in reader socket shows higher latency than data homed in writer socket?
- Performance implications of aliasing in VIPT cache
- Why do fast memory writes when run over multiple threads take much more time vs when they are run on a single thread?
- question regarding the behavior of the program in Meltdown attack
- Seeking Verification: MIPS Cache Set Update Analysis
- OS cache/memory hierarchy: How does writing to a new file work?
- Can there be a cache block with the same Tag-ID in different Sets?
- is it a way to do a "store" operation without fetching in case of cache miss
- why is there a need to stop prefetching to pages when a write happens to it?
- is it possible that a cpu has several L3 level caches?
- Are 64-byte CPU cache line reads aligned on 64-byte boundaries?
- how cpu cache when physical address is not contiguous
Related Questions in CACHE-INVALIDATION
- How to fix invalidate cache data problem in React RTK Query?
- Is there an RXJS/Angular service pattern to efficiently re-fetch a POST (not a GET), alerting any number of consumers
- run queries only after query invalidation with react-query
- Problem with concurrent flushing tagged Redis cache in Laravel
- GCP Cloud CDN cache invalidation taking too long
- Cache invalidation for JWT public key in microservices architecture
- AWS Cloudfront. Force browser to revalidate but not CDN
- Check AWS Cloudfront invalidation complete time?
- Invalid language element error in Assembly
- Update cache of periodical react-query with refetchInterval from other place
- How to invalidate a cloudfront path that contains a tilde ~ character?
- Cache Invalidation In Redis for Client side caching [Special Case]
- Why do we need both hardware support and software instructions for invalidating cache?
- React Query: InvalidateQuery not working to update users list
- Invalidation of the cache from L1 cache
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
The case described is not allowed. When a processor core executes a store to an address, the data is written to a "store buffer" for transfer to the cache at a later time. Before transferring data from the store buffer, the cache requires Exclusive access to the line -- a state that can exist in only one cache at a time.
Three easy cases:
If two cores execute store instructions "at the same time", the details of the implementation will result in one of two the cores obtaining exclusive access. The other core will have its request "rejected" (NACK'd), and it will retry the request until the first core+cache has completed its upgrade of the cache line state and update of the data. This mechanism forces all stores to a single address to be processed sequentially, even if they are issued concurrently.
In general it is not possible for a user to reliably make something happen "at the same time" in two cores (or to detect whether it happened at the same time), but the implementations have to account for it by the serialization process described above.