Lines Matching refs:ACCESS_ONCE
197 ACCESS_ONCE(Q) = P; smp_read_barrier_depends(); D = ACCESS_ONCE(*Q);
204 does nothing, but it is required for DEC Alpha. The ACCESS_ONCE()
212 a = ACCESS_ONCE(*X); ACCESS_ONCE(*X) = b;
220 ACCESS_ONCE(*X) = c; d = ACCESS_ONCE(*X);
232 memory references that are not protected by ACCESS_ONCE(). Without
233 ACCESS_ONCE(), the compiler is within its rights to do all sorts
523 ACCESS_ONCE(P) = &B
524 Q = ACCESS_ONCE(P);
550 ACCESS_ONCE(P) = &B
551 Q = ACCESS_ONCE(P);
577 ACCESS_ONCE(P) = 1
578 Q = ACCESS_ONCE(P);
599 q = ACCESS_ONCE(a);
602 p = ACCESS_ONCE(b);
611 q = ACCESS_ONCE(a);
614 p = ACCESS_ONCE(b);
620 q = ACCESS_ONCE(a);
622 ACCESS_ONCE(b) = p;
626 That said, please note that ACCESS_ONCE() is not optional! Without the
627 ACCESS_ONCE(), might combine the load from 'a' with other loads from
639 So don't leave out the ACCESS_ONCE().
644 q = ACCESS_ONCE(a);
647 ACCESS_ONCE(b) = p;
651 ACCESS_ONCE(b) = p;
658 q = ACCESS_ONCE(a);
660 ACCESS_ONCE(b) = p; /* BUG: No ordering vs. load from a!!! */
662 /* ACCESS_ONCE(b) = p; -- moved up, BUG!!! */
665 /* ACCESS_ONCE(b) = p; -- moved up, BUG!!! */
676 q = ACCESS_ONCE(a);
688 q = ACCESS_ONCE(a);
690 ACCESS_ONCE(b) = p;
693 ACCESS_ONCE(b) = r;
697 The initial ACCESS_ONCE() is still required to prevent the compiler from
704 q = ACCESS_ONCE(a);
706 ACCESS_ONCE(b) = p;
709 ACCESS_ONCE(b) = r;
717 q = ACCESS_ONCE(a);
718 ACCESS_ONCE(b) = p;
728 q = ACCESS_ONCE(a);
731 ACCESS_ONCE(b) = p;
734 ACCESS_ONCE(b) = r;
745 q = ACCESS_ONCE(a);
747 ACCESS_ONCE(b) = 1;
752 q = ACCESS_ONCE(a);
753 ACCESS_ONCE(b) = 1;
756 out-guess your code. More generally, although ACCESS_ONCE() does force
766 r1 = ACCESS_ONCE(x); r2 = ACCESS_ONCE(y);
768 ACCESS_ONCE(y) = 1; ACCESS_ONCE(x) = 1;
778 ACCESS_ONCE(x) = 2;
809 optimized away the ordering. Careful use of ACCESS_ONCE() can
813 dependency into nonexistence. Careful use of ACCESS_ONCE() or
840 ACCESS_ONCE(a) = 1;
842 ACCESS_ONCE(b) = 2; x = ACCESS_ONCE(b);
844 y = ACCESS_ONCE(a);
852 ACCESS_ONCE(b) = &a; x = ACCESS_ONCE(b);
860 r1 = ACCESS_ONCE(y);
862 ACCESS_ONCE(y) = 1; if (r2 = ACCESS_ONCE(x)) {
864 ACCESS_ONCE(y) = 1;
878 ACCESS_ONCE(a) = 1; }---- --->{ v = ACCESS_ONCE(c);
879 ACCESS_ONCE(b) = 2; } \ / { w = ACCESS_ONCE(d);
881 ACCESS_ONCE(c) = 3; } / \ { x = ACCESS_ONCE(a);
882 ACCESS_ONCE(d) = 4; }---- --->{ y = ACCESS_ONCE(b);
1333 of barrier(). However, ACCESS_ONCE() can be thought of as a weak form
1335 ACCESS_ONCE().
1347 The ACCESS_ONCE() function can prevent any number of optimizations that,
1362 a[0] = ACCESS_ONCE(x);
1363 a[1] = ACCESS_ONCE(x);
1365 In short, ACCESS_ONCE() provides cache coherence for accesses from
1383 Use ACCESS_ONCE() to prevent the compiler from doing this to you:
1385 while (tmp = ACCESS_ONCE(a))
1407 Again, use ACCESS_ONCE() to prevent the compiler from doing this:
1409 while (tmp = ACCESS_ONCE(a))
1433 proof will be erroneous. Use ACCESS_ONCE() to tell the compiler
1436 while (tmp = ACCESS_ONCE(a))
1440 do with the value after the ACCESS_ONCE(). For example, suppose you
1443 while ((tmp = ACCESS_ONCE(a)) % MAX)
1467 Use ACCESS_ONCE() to prevent the compiler from making this sort of
1470 ACCESS_ONCE(a) = 0;
1472 ACCESS_ONCE(a) = 0;
1501 interrupt_handler() might be passed a garbled msg. Use ACCESS_ONCE()
1506 ACCESS_ONCE(msg) = get_message();
1507 ACCESS_ONCE(flag) = true;
1512 if (ACCESS_ONCE(flag))
1513 process_message(ACCESS_ONCE(msg));
1516 Note that the ACCESS_ONCE() wrappers in interrupt_handler()
1519 a nested interrupt or an NMI. Otherwise, ACCESS_ONCE() is not
1525 You should assume that the compiler can move ACCESS_ONCE() past
1526 code not containing ACCESS_ONCE(), barrier(), or similar primitives.
1528 This effect could also be achieved using barrier(), but ACCESS_ONCE()
1529 is more selective: With ACCESS_ONCE(), the compiler need only forget
1533 the compiler must also respect the order in which the ACCESS_ONCE()s
1554 Use ACCESS_ONCE() to prevent this as follows:
1557 ACCESS_ONCE(b) = a;
1559 ACCESS_ONCE(b) = 42;
1563 poor performance and scalability. Use ACCESS_ONCE() to prevent
1582 use of ACCESS_ONCE() prevents store tearing in the following example:
1584 ACCESS_ONCE(p) = 0x00010002;
1601 Because there are no ACCESS_ONCE() wrappers and no volatile markings,
1605 and store tearing on 'foo2.b'. ACCESS_ONCE() again prevents tearing
1609 ACCESS_ONCE(foo2.b) = ACCESS_ONCE(foo1.b);
1612 All that aside, it is never necessary to use ACCESS_ONCE() on a variable
1614 volatile, it is never necessary to say ACCESS_ONCE(jiffies). The reason
1615 for this is that ACCESS_ONCE() is implemented as a volatile cast, which
1645 however the ACCESS_ONCE macro is a good place to start looking.
2119 ACCESS_ONCE(*A) = a; ACCESS_ONCE(*E) = e;
2121 ACCESS_ONCE(*B) = b; ACCESS_ONCE(*F) = f;
2122 ACCESS_ONCE(*C) = c; ACCESS_ONCE(*G) = g;
2124 ACCESS_ONCE(*D) = d; ACCESS_ONCE(*H) = h;
2144 ACCESS_ONCE(*A) = a;
2146 ACCESS_ONCE(*B) = b;
2147 ACCESS_ONCE(*C) = c;
2149 ACCESS_ONCE(*D) = d; ACCESS_ONCE(*E) = e;
2152 ACCESS_ONCE(*F) = f;
2153 ACCESS_ONCE(*G) = g;
2155 ACCESS_ONCE(*H) = h;
2874 a = ACCESS_ONCE(*A);
2875 ACCESS_ONCE(*B) = b;
2876 c = ACCESS_ONCE(*C);
2877 d = ACCESS_ONCE(*D);
2878 ACCESS_ONCE(*E) = e;
2925 U = ACCESS_ONCE(*A);
2926 ACCESS_ONCE(*A) = V;
2927 ACCESS_ONCE(*A) = W;
2928 X = ACCESS_ONCE(*A);
2929 ACCESS_ONCE(*A) = Y;
2930 Z = ACCESS_ONCE(*A);
2947 the world remains consistent. Note that ACCESS_ONCE() is -not- optional
2950 ACCESS_ONCE() does whatever is necessary to prevent this, for example, on
2951 Itanium the volatile casts used by ACCESS_ONCE() cause GCC to emit the
2966 since, without either a write barrier or an ACCESS_ONCE(), it can be
2972 may, without a memory barrier or an ACCESS_ONCE(), be reduced to: