diff options
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/memory-barriers.txt | 16 |
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 | ||
653 | If, however, a data dependency barrier were to be placed between the load of C | 654 | If, however, a data dependency barrier were to be placed between the load of C |
654 | and the load of *C (ie: B) on CPU 2, then the following will occur: | 655 | and 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 | |||
668 | then the following will occur: | ||
655 | 669 | ||
656 | +-------+ : : : : | 670 | +-------+ : : : : |
657 | | | +------+ +-------+ | 671 | | | +------+ +-------+ |