@@ -223,7 +223,7 @@ The Linux kernel's compiler barrier is barrier(). This primitive
223
223
prohibits compiler code-motion optimizations that might move memory
224
224
references across the point in the code containing the barrier(), but
225
225
does not constrain hardware memory ordering. For example, this can be
226
- used to prevent to compiler from moving code across an infinite loop:
226
+ used to prevent the compiler from moving code across an infinite loop:
227
227
228
228
WRITE_ONCE(x, 1);
229
229
while (dontstop)
@@ -274,7 +274,7 @@ different pieces of the concurrent algorithm. The variable stored to
274
274
by the smp_store_release(), in this case "y", will normally be used in
275
275
an acquire operation in other parts of the concurrent algorithm.
276
276
277
- To see the performance advantages, suppose that the above example read
277
+ To see the performance advantages, suppose that the above example reads
278
278
from "x" instead of writing to it. Then an smp_wmb() could not guarantee
279
279
ordering, and an smp_mb() would be needed instead:
280
280
@@ -394,17 +394,17 @@ from the value returned by the rcu_dereference() or srcu_dereference()
394
394
to that subsequent memory access.
395
395
396
396
A call to rcu_dereference() for a given RCU-protected pointer is
397
- usually paired with a call to a call to rcu_assign_pointer() for that
398
- same pointer in much the same way that a call to smp_load_acquire() is
399
- paired with a call to smp_store_release(). Calls to rcu_dereference()
400
- and rcu_assign_pointer are often buried in other APIs, for example,
397
+ usually paired with a call to rcu_assign_pointer() for that same pointer
398
+ in much the same way that a call to smp_load_acquire() is paired with
399
+ a call to smp_store_release(). Calls to rcu_dereference() and
400
+ rcu_assign_pointer() are often buried in other APIs, for example,
401
401
the RCU list API members defined in include/linux/rculist.h. For more
402
402
information, please see the docbook headers in that file, the most
403
- recent LWN article on the RCU API (https://lwn.net/Articles/777036 /),
403
+ recent LWN article on the RCU API (https://lwn.net/Articles/988638 /),
404
404
and of course the material in Documentation/RCU.
405
405
406
406
If the pointer value is manipulated between the rcu_dereference()
407
- that returned it and a later dereference (), please read
407
+ that returned it and a later rcu_dereference (), please read
408
408
Documentation/RCU/rcu_dereference.rst. It can also be quite helpful to
409
409
review uses in the Linux kernel.
410
410
@@ -457,15 +457,15 @@ described earlier in this document.
457
457
These operations come in three categories:
458
458
459
459
o Marked writes, such as WRITE_ONCE() and atomic_set(). These
460
- primitives required the compiler to emit the corresponding store
460
+ primitives require the compiler to emit the corresponding store
461
461
instructions in the expected execution order, thus suppressing
462
462
a number of destructive optimizations. However, they provide no
463
463
hardware ordering guarantees, and in fact many CPUs will happily
464
464
reorder marked writes with each other or with other unordered
465
465
operations, unless these operations are to the same variable.
466
466
467
467
o Marked reads, such as READ_ONCE() and atomic_read(). These
468
- primitives required the compiler to emit the corresponding load
468
+ primitives require the compiler to emit the corresponding load
469
469
instructions in the expected execution order, thus suppressing
470
470
a number of destructive optimizations. However, they provide no
471
471
hardware ordering guarantees, and in fact many CPUs will happily
@@ -506,7 +506,7 @@ of the old value and the new value.
506
506
507
507
Unmarked C-language accesses are unordered, and are also subject to
508
508
any number of compiler optimizations, many of which can break your
509
- concurrent code. It is possible to used unmarked C-language accesses for
509
+ concurrent code. It is possible to use unmarked C-language accesses for
510
510
shared variables that are subject to concurrent access, but great care
511
511
is required on an ongoing basis. The compiler-constraining barrier()
512
512
primitive can be helpful, as can the various ordering primitives discussed
0 commit comments