memory-barriers.txt (08d99b2c23dfa84ca5b5e5c194062a0550888b71) memory-barriers.txt (72ef5e52b3f74c0be47b20f5c434b7ecc830cf40)
1 ============================
2 LINUX KERNEL MEMORY BARRIERS
3 ============================
4
5By: David Howells <dhowells@redhat.com>
6 Paul E. McKenney <paulmck@linux.ibm.com>
7 Will Deacon <will.deacon@arm.com>
8 Peter Zijlstra <peterz@infradead.org>

--- 606 unchanged lines hidden (view full) ---

615but the old value of the variable B (2).
616
617
618A data-dependency barrier is not required to order dependent writes
619because the CPUs that the Linux kernel supports don't do writes
620until they are certain (1) that the write will actually happen, (2)
621of the location of the write, and (3) of the value to be written.
622But please carefully read the "CONTROL DEPENDENCIES" section and the
1 ============================
2 LINUX KERNEL MEMORY BARRIERS
3 ============================
4
5By: David Howells <dhowells@redhat.com>
6 Paul E. McKenney <paulmck@linux.ibm.com>
7 Will Deacon <will.deacon@arm.com>
8 Peter Zijlstra <peterz@infradead.org>

--- 606 unchanged lines hidden (view full) ---

615but the old value of the variable B (2).
616
617
618A data-dependency barrier is not required to order dependent writes
619because the CPUs that the Linux kernel supports don't do writes
620until they are certain (1) that the write will actually happen, (2)
621of the location of the write, and (3) of the value to be written.
622But please carefully read the "CONTROL DEPENDENCIES" section and the
623Documentation/RCU/rcu_dereference.txt file: The compiler can and does
623Documentation/RCU/rcu_dereference.rst file: The compiler can and does
624break dependencies in a great many highly creative ways.
625
626 CPU 1 CPU 2
627 =============== ===============
628 { A == 1, B == 2, C = 3, P == &A, Q == &C }
629 B = 4;
630 <write barrier>
631 WRITE_ONCE(P, &B);

--- 2480 unchanged lines hidden ---
624break dependencies in a great many highly creative ways.
625
626 CPU 1 CPU 2
627 =============== ===============
628 { A == 1, B == 2, C = 3, P == &A, Q == &C }
629 B = 4;
630 <write barrier>
631 WRITE_ONCE(P, &B);

--- 2480 unchanged lines hidden ---