Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <akiyks@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Acked-by: Andrea Parri <parri.andrea@gmail.com>

authored by

Akira Yokosawa and committed by
Paul E. McKenney
f0a83980 366b88f6

+11 -11
+11 -11
tools/memory-model/Documentation/ordering.txt
··· 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 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 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 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 ··· 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 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