Skip to content

Commit f0a8398

Browse files
akiykspaulmckrcu
authored andcommitted
tools/memory-model: docs/ordering: Fix trivial typos
Fix trivial typos including: - Repeated "a call to" - Inconsistent forms of referencing functions of rcu_dereference() and rcu_assign_pointer() - Past tense used in describing normal behavior and other minor ones. [ paulmck: Wordsmith plus recent LWN RCU API URL. ] Signed-off-by: Akira Yokosawa <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]> Acked-by: Andrea Parri <[email protected]>
1 parent 366b88f commit f0a8398

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

tools/memory-model/Documentation/ordering.txt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ The Linux kernel's compiler barrier is barrier(). This primitive
223223
prohibits compiler code-motion optimizations that might move memory
224224
references across the point in the code containing the barrier(), but
225225
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:
227227

228228
WRITE_ONCE(x, 1);
229229
while (dontstop)
@@ -274,7 +274,7 @@ different pieces of the concurrent algorithm. The variable stored to
274274
by the smp_store_release(), in this case "y", will normally be used in
275275
an acquire operation in other parts of the concurrent algorithm.
276276

277-
To see the performance advantages, suppose that the above example read
277+
To see the performance advantages, suppose that the above example reads
278278
from "x" instead of writing to it. Then an smp_wmb() could not guarantee
279279
ordering, and an smp_mb() would be needed instead:
280280

@@ -394,17 +394,17 @@ from the value returned by the rcu_dereference() or srcu_dereference()
394394
to that subsequent memory access.
395395

396396
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,
401401
the RCU list API members defined in include/linux/rculist.h. For more
402402
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/),
404404
and of course the material in Documentation/RCU.
405405

406406
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
408408
Documentation/RCU/rcu_dereference.rst. It can also be quite helpful to
409409
review uses in the Linux kernel.
410410

@@ -457,15 +457,15 @@ described earlier in this document.
457457
These operations come in three categories:
458458

459459
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
461461
instructions in the expected execution order, thus suppressing
462462
a number of destructive optimizations. However, they provide no
463463
hardware ordering guarantees, and in fact many CPUs will happily
464464
reorder marked writes with each other or with other unordered
465465
operations, unless these operations are to the same variable.
466466

467467
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
469469
instructions in the expected execution order, thus suppressing
470470
a number of destructive optimizations. However, they provide no
471471
hardware ordering guarantees, and in fact many CPUs will happily
@@ -506,7 +506,7 @@ of the old value and the new value.
506506

507507
Unmarked C-language accesses are unordered, and are also subject to
508508
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
510510
shared variables that are subject to concurrent access, but great care
511511
is required on an ongoing basis. The compiler-constraining barrier()
512512
primitive can be helpful, as can the various ordering primitives discussed

0 commit comments

Comments
 (0)