aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2006-04-11 01:54:24 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-04-11 09:18:44 -0400
commitc14038c39ddd9c14225907a05a6ac4d91d645ef1 (patch)
treea9f57acaaf9764b35ab9e50f370b8e6859f9501e /Documentation
parentdbc8700e27a94621de9d22c506c67913e0121501 (diff)
[PATCH] Improve data-dependency memory barrier example in documentation
In the memory barrier document, improve the example of the data dependency barrier situation by: (1) showing the initial values of the variables involved; and (2) repeating the instruction sequence description, this time with the data dependency barrier actually shown to make it clear what the revised sequence actually is. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/memory-barriers.txt16
1 files changed, 15 insertions, 1 deletions
diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt
index 528d52f52eeb..92f0056d928c 100644
--- a/Documentation/memory-barriers.txt
+++ b/Documentation/memory-barriers.txt
@@ -610,6 +610,7 @@ loads. Consider the following sequence of events:
610 610
611 CPU 1 CPU 2 611 CPU 1 CPU 2
612 ======================= ======================= 612 ======================= =======================
613 { B = 7; X = 9; Y = 8; C = &Y }
613 STORE A = 1 614 STORE A = 1
614 STORE B = 2 615 STORE B = 2
615 <write barrier> 616 <write barrier>
@@ -651,7 +652,20 @@ In the above example, CPU 2 perceives that B is 7, despite the load of *C
651(which would be B) coming after the the LOAD of C. 652(which would be B) coming after the the LOAD of C.
652 653
653If, however, a data dependency barrier were to be placed between the load of C 654If, however, a data dependency barrier were to be placed between the load of C
654and the load of *C (ie: B) on CPU 2, then the following will occur: 655and the load of *C (ie: B) on CPU 2:
656
657 CPU 1 CPU 2
658 ======================= =======================
659 { B = 7; X = 9; Y = 8; C = &Y }
660 STORE A = 1
661 STORE B = 2
662 <write barrier>
663 STORE C = &B LOAD X
664 STORE D = 4 LOAD C (gets &B)
665 <data dependency barrier>
666 LOAD *C (reads B)
667
668then the following will occur:
655 669
656 +-------+ : : : : 670 +-------+ : : : :
657 | | +------+ +-------+ 671 | | +------+ +-------+