LFD114 - Issue on describing Ztso disallowing store -> load reordering on ch 6, lesson 9
Hello!
I was reading chapter 06. "MEMORY MODEL -ARM & RISCV-V" and in Lesson 9, "RISC-V TSO (Ztso): Who Enables It, When, and What Changes", I encountered this line :
"Ztso is the RISC-V extension that makes the machine behave like a Total Store Order (TSO) system (i.e., the same high-level ordering guarantees programmers expect on x86). In effect, ordinary loads act like acquire, ordinary stores act like release, and store→load reordering is disallowed. Given the hardware is already “paying” this cost, when targeting TSO hardware the compilers no longer need to emit fence instructions to implement load-acquire or store-release. "
It says store->load reordering is disallowed for TSO.
I was reading the "Computer Architecture: A Quantative appraoch, 7th edition, page 431", it said:
"Sequential consistency requires maintaining all four possible orderings:
R -> W; R -> R; W -> R; and W -> W.
The relaxed models are defined by the subset of four orderings they relax: Relaxing only the W -> R ordering yields a model known as total store ordering or processor consistency."
So, I am confused as to why it said "store->load reordering is disallowed". The book says its relaxed.
Best Answers
-
Hi Afsan,
It seems to me that the statement in the Chapter 06, Lesson 9 is in fact not accurate. It might be that the author meant to write that "store->load reordering is allowed". The way I understand it is that
store --> loadreordering is the only one that can be allowed.Here's how I see it. From the RISC-V specs:
RVTSO makes the following adjustments to RVWMO:
- All load operations behave as if they have an acquire-RCpc annotation
- All store operations behave as if they have a release-RCpc annotation.
- All AMOs behave as if they have both acquire-RCsc and release-RCsc annotations.Putting AMOs aside, a load with acquire-RCpc orders what comes after it, a store with release-RCpc orders what comes before it. So if we consider this example:
sw (instruction A) sw (instruction B) lw (instruction C) lw (instruction D)
The specs rules say that
(A) --> (B)are ordered (because (B) is now release-RCpc) and(C) --> (D)are ordered (because (C) is now acquire RC-pc), but says nothing about any ordering of stores to load. So the order(C) --> (D) --> (A) --> (B)is valid under Ztso, same as(A) --> (C) --> (B) --> (D).1 -
Hi @Afsan ,
Thank you for bringing this issue to our attention. This is was really helpful!
We have updated Lesson 9 of Chapter 6: RISC-V TSO (Ztso): Who Enables It, When, and What Changes. You should see the changes reflected in the course. If you see anything else that we need to address, please don't hesitate to bring it up in the Forum.
All the best,
Ariane
Linux Foundation Education1
Answers
-
@noureddi , Its just that, in the following sentence it says,
"You do not insert a fence after every store under TSO; rather, TSO’s rules inherently forbid store→load reordering." .
I believe,
store→loadreordering is not allowed if its same address. But, Its not written here.0
Categories
- All Categories
- 179 LFX Mentorship
- 179 LFX Mentorship: Linux Kernel
- 776 Linux Foundation IT Professional Programs
- 384 Cloud Engineer IT Professional Program
- 175 Advanced Cloud Engineer IT Professional Program
- 76 DevOps IT Professional Program - Discontinued
- 7 DevOps & GitOps IT Professional Program
- 103 Cloud Native Developer IT Professional Program
- 7.7K Training Courses & Learning Paths
- 21 AI & ML Training
- 2 Blockchain & Decentralized Identity Training
- 49 Cloud & Containers Training
- 7 Cybersecurity Training
- 5 DevOps & Site-Reliability Training
- 3 Linux Kernel Development Training
- 3 Networking Training
- 2 Open Source Best Practice Training
- 7 System Administration Training
- 1 System Engineering Training
- 6 Web & Application Development Training
- 798 Hardware
- 202 Drivers
- 68 I/O Devices
- 37 Monitors
- 96 Multimedia
- 173 Networking
- 91 Printers & Scanners
- 92 Storage
- 776 Linux Distributions
- 83 Debian
- 68 Fedora
- 25 Linux Mint
- 13 Mageia
- 24 openSUSE
- 151 Red Hat Enterprise
- 32 Slackware
- 13 SUSE Enterprise
- 356 Ubuntu
- 473 Linux System Administration
- 31 Cloud Computing
- 73 Command Line/Scripting
- Github systems admin projects
- 104 Linux Security
- 79 Network Management
- 102 System Management
- 46 Web Management
- 185 Mobile Computing
- 32 Android
- 137 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 407 Off Topic
- 128 Introductions
- 35 Study Material
- 1.1K Programming and Development
- 312 Kernel Development
- 732 Software Development
- 1K Software
- 421 Applications
- 183 Command Line
- 5 Compiling/Installing
- 71 Games
- 320 Installation
- Archived
- 183 Small Talk
- 2 LFD140 Class Forum
- 1.4K LFS258 Class Forum
Upcoming Training
-
August 20, 2018
Kubernetes Administration (LFS458)
-
August 20, 2018
Linux System Administration (LFS301)
-
August 27, 2018
Open Source Virtualization (LFS462)
-
August 27, 2018
Linux Kernel Debugging and Security (LFD440)