]> Git Repo - linux.git/commitdiff
Merge branch 'for-mingo-rcu' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck...
authorIngo Molnar <[email protected]>
Fri, 12 Feb 2021 11:50:09 +0000 (12:50 +0100)
committerIngo Molnar <[email protected]>
Fri, 12 Feb 2021 11:56:55 +0000 (12:56 +0100)
Pull RCU updates from Paul E. McKenney:

- Documentation updates.

- Miscellaneous fixes.

- kfree_rcu() updates: Addition of mem_dump_obj() to provide allocator return
  addresses to more easily locate bugs.  This has a couple of RCU-related commits,
  but is mostly MM.  Was pulled in with akpm's agreement.

- Per-callback-batch tracking of numbers of callbacks,
  which enables better debugging information and smarter
  reactions to large numbers of callbacks.

- The first round of changes to allow CPUs to be runtime switched from and to
  callback-offloaded state.

- CONFIG_PREEMPT_RT-related changes.

- RCU CPU stall warning updates.
- Addition of polling grace-period APIs for SRCU.

- Torture-test and torture-test scripting updates, including a "torture everything"
  script that runs rcutorture, locktorture, scftorture, rcuscale, and refscale.
  Plus does an allmodconfig build.

Signed-off-by: Ingo Molnar <[email protected]>
1  2 
Documentation/RCU/Design/Requirements/Requirements.rst
Documentation/admin-guide/kernel-parameters.txt
include/linux/mm.h
include/linux/vmalloc.h
kernel/sched/core.c
mm/slub.c
mm/vmalloc.c

index d4c9a016074b3c7476819d291cb8105597d3760b,0da9133fa13ab675ff624868560fdbfbd98e3953..38a39476fc248af893ab574bd13e4eed92278fdf
@@@ -45,7 -45,7 +45,7 @@@ requirements
  #. `Other RCU Flavors`_
  #. `Possible Future Changes`_
  
 -This is followed by a `summary <#Summary>`__, however, the answers to
 +This is followed by a summary_, however, the answers to
  each quick quiz immediately follows the quiz. Select the big white space
  with your mouse to see the answer.
  
@@@ -72,13 -72,13 +72,13 @@@ understanding of this guarantee
  
  RCU's grace-period guarantee allows updaters to wait for the completion
  of all pre-existing RCU read-side critical sections. An RCU read-side
- critical section begins with the marker ``rcu_read_lock()`` and ends
- with the marker ``rcu_read_unlock()``. These markers may be nested, and
+ critical section begins with the marker rcu_read_lock() and ends
+ with the marker rcu_read_unlock(). These markers may be nested, and
  RCU treats a nested set as one big RCU read-side critical section.
- Production-quality implementations of ``rcu_read_lock()`` and
``rcu_read_unlock()`` are extremely lightweight, and in fact have
+ Production-quality implementations of rcu_read_lock() and
rcu_read_unlock() are extremely lightweight, and in fact have
  exactly zero overhead in Linux kernels built for production use with
- ``CONFIG_PREEMPT=n``.
+ ``CONFIG_PREEMPTION=n``.
  
  This guarantee allows ordering to be enforced with extremely low
  overhead to readers, for example:
        15   WRITE_ONCE(y, 1);
        16 }
  
- Because the ``synchronize_rcu()`` on line 14 waits for all pre-existing
- readers, any instance of ``thread0()`` that loads a value of zero from
- ``x`` must complete before ``thread1()`` stores to ``y``, so that
+ Because the synchronize_rcu() on line 14 waits for all pre-existing
+ readers, any instance of thread0() that loads a value of zero from
+ ``x`` must complete before thread1() stores to ``y``, so that
  instance must also load a value of zero from ``y``. Similarly, any
- instance of ``thread0()`` that loads a value of one from ``y`` must have
- started after the ``synchronize_rcu()`` started, and must therefore also
+ instance of thread0() that loads a value of one from ``y`` must have
+ started after the synchronize_rcu() started, and must therefore also
  load a value of one from ``x``. Therefore, the outcome:
  
     ::
@@@ -121,14 -121,14 +121,14 @@@ cannot happen
  +-----------------------------------------------------------------------+
  | Wait a minute! You said that updaters can make useful forward         |
  | progress concurrently with readers, but pre-existing readers will     |
- | block ``synchronize_rcu()``!!!                                        |
+ | block synchronize_rcu()!!!                                            |
  | Just who are you trying to fool???                                    |
  +-----------------------------------------------------------------------+
  | **Answer**:                                                           |
  +-----------------------------------------------------------------------+
  | First, if updaters do not wish to be blocked by readers, they can use |
- | ``call_rcu()`` or ``kfree_rcu()``, which will be discussed later.     |
- | Second, even when using ``synchronize_rcu()``, the other update-side  |
+ | call_rcu() or kfree_rcu(), which will be discussed later.             |
+ | Second, even when using synchronize_rcu(), the other update-side      |
  | code does run concurrently with readers, whether pre-existing or not. |
  +-----------------------------------------------------------------------+
  
@@@ -170,34 -170,34 +170,34 @@@ recovery from node failure, more or les
        29   WRITE_ONCE(state, STATE_NORMAL);
        30 }
  
- The RCU read-side critical section in ``do_something_dlm()`` works with
- the ``synchronize_rcu()`` in ``start_recovery()`` to guarantee that
``do_something()`` never runs concurrently with ``recovery()``, but with
- little or no synchronization overhead in ``do_something_dlm()``.
+ The RCU read-side critical section in do_something_dlm() works with
+ the synchronize_rcu() in start_recovery() to guarantee that
do_something() never runs concurrently with recovery(), but with
+ little or no synchronization overhead in do_something_dlm().
  
  +-----------------------------------------------------------------------+
  | **Quick Quiz**:                                                       |
  +-----------------------------------------------------------------------+
- | Why is the ``synchronize_rcu()`` on line 28 needed?                   |
+ | Why is the synchronize_rcu() on line 28 needed?                       |
  +-----------------------------------------------------------------------+
  | **Answer**:                                                           |
  +-----------------------------------------------------------------------+
  | Without that extra grace period, memory reordering could result in    |
- | ``do_something_dlm()`` executing ``do_something()`` concurrently with |
- | the last bits of ``recovery()``.                                      |
+ | do_something_dlm() executing do_something() concurrently with         |
+ | the last bits of recovery().                                          |
  +-----------------------------------------------------------------------+
  
  In order to avoid fatal problems such as deadlocks, an RCU read-side
- critical section must not contain calls to ``synchronize_rcu()``.
+ critical section must not contain calls to synchronize_rcu().
  Similarly, an RCU read-side critical section must not contain anything
  that waits, directly or indirectly, on completion of an invocation of
``synchronize_rcu()``.
synchronize_rcu().
  
  Although RCU's grace-period guarantee is useful in and of itself, with
  `quite a few use cases <https://lwn.net/Articles/573497/>`__, it would
  be good to be able to use RCU to coordinate read-side access to linked
  data structures. For this, the grace-period guarantee is not sufficient,
- as can be seen in function ``add_gp_buggy()`` below. We will look at the
+ as can be seen in function add_gp_buggy() below. We will look at the
  reader's code later, but in the meantime, just think of the reader as
  locklessly picking up the ``gp`` pointer, and, if the value loaded is
  non-\ ``NULL``, locklessly accessing the ``->a`` and ``->b`` fields.
@@@ -256,8 -256,8 +256,8 @@@ Publish/Subscribe Guarante
  
  RCU's publish-subscribe guarantee allows data to be inserted into a
  linked data structure without disrupting RCU readers. The updater uses
``rcu_assign_pointer()`` to insert the new data, and readers use
``rcu_dereference()`` to access data, whether new or old. The following
rcu_assign_pointer() to insert the new data, and readers use
rcu_dereference() to access data, whether new or old. The following
  shows an example of insertion:
  
     ::
        15   return true;
        16 }
  
- The ``rcu_assign_pointer()`` on line 13 is conceptually equivalent to a
+ The rcu_assign_pointer() on line 13 is conceptually equivalent to a
  simple assignment statement, but also guarantees that its assignment
  will happen after the two assignments in lines 11 and 12, similar to the
  C11 ``memory_order_release`` store operation. It also prevents any
@@@ -289,7 -289,7 +289,7 @@@ number of “interesting” compiler op
  +-----------------------------------------------------------------------+
  | **Quick Quiz**:                                                       |
  +-----------------------------------------------------------------------+
- | But ``rcu_assign_pointer()`` does nothing to prevent the two          |
+ | But rcu_assign_pointer() does nothing to prevent the two              |
  | assignments to ``p->a`` and ``p->b`` from being reordered. Can't that |
  | also cause problems?                                                  |
  +-----------------------------------------------------------------------+
  
  It is tempting to assume that the reader need not do anything special to
  control its accesses to the RCU-protected data, as shown in
``do_something_gp_buggy()`` below:
do_something_gp_buggy() below:
  
     ::
  
        12 }
  
  However, this temptation must be resisted because there are a
- surprisingly large number of ways that the compiler (to say nothing of
- `DEC Alpha CPUs <https://h71000.www7.hp.com/wizard/wiz_2637.html>`__)
- can trip this code up. For but one example, if the compiler were short
- of registers, it might choose to refetch from ``gp`` rather than keeping
- a separate copy in ``p`` as follows:
+ surprisingly large number of ways that the compiler (or weak ordering
+ CPUs like the DEC Alpha) can trip this code up. For but one example, if
+ the compiler were short of registers, it might choose to refetch from
+ ``gp`` rather than keeping a separate copy in ``p`` as follows:
  
     ::
  
@@@ -345,7 -344,7 +344,7 @@@ If this function ran concurrently with 
  the current structure with a new one, the fetches of ``gp->a`` and
  ``gp->b`` might well come from two different structures, which could
  cause serious confusion. To prevent this (and much else besides),
``do_something_gp()`` uses ``rcu_dereference()`` to fetch from ``gp``:
do_something_gp() uses rcu_dereference() to fetch from ``gp``:
  
     ::
  
        11   return false;
        12 }
  
- The ``rcu_dereference()`` uses volatile casts and (for DEC Alpha) memory
+ The rcu_dereference() uses volatile casts and (for DEC Alpha) memory
  barriers in the Linux kernel. Should a `high-quality implementation of
  C11 ``memory_order_consume``
  [PDF] <http://www.rdrop.com/users/paulmck/RCU/consume.2015.07.13a.pdf>`__
- ever appear, then ``rcu_dereference()`` could be implemented as a
+ ever appear, then rcu_dereference() could be implemented as a
  ``memory_order_consume`` load. Regardless of the exact implementation, a
- pointer fetched by ``rcu_dereference()`` may not be used outside of the
+ pointer fetched by rcu_dereference() may not be used outside of the
  outermost RCU read-side critical section containing that
``rcu_dereference()``, unless protection of the corresponding data
rcu_dereference(), unless protection of the corresponding data
  element has been passed from RCU to some other synchronization
  mechanism, most commonly locking or `reference
  counting <https://www.kernel.org/doc/Documentation/RCU/rcuref.txt>`__.
  
- In short, updaters use ``rcu_assign_pointer()`` and readers use
``rcu_dereference()``, and these two RCU API elements work together to
+ In short, updaters use rcu_assign_pointer() and readers use
rcu_dereference(), and these two RCU API elements work together to
  ensure that readers have a consistent view of newly added data elements.
  
  Of course, it is also necessary to remove elements from RCU-protected
@@@ -388,9 -387,9 +387,9 @@@ data structures, for example, using th
     the newly removed data element).
  #. At this point, only the updater has a reference to the newly removed
     data element, so it can safely reclaim the data element, for example,
-    by passing it to ``kfree()``.
+    by passing it to kfree().
  
- This process is implemented by ``remove_gp_synchronous()``:
+ This process is implemented by remove_gp_synchronous():
  
     ::
  
  
  This function is straightforward, with line 13 waiting for a grace
  period before line 14 frees the old data element. This waiting ensures
- that readers will reach line 7 of ``do_something_gp()`` before the data
- element referenced by ``p`` is freed. The ``rcu_access_pointer()`` on
- line 6 is similar to ``rcu_dereference()``, except that:
+ that readers will reach line 7 of do_something_gp() before the data
+ element referenced by ``p`` is freed. The rcu_access_pointer() on
+ line 6 is similar to rcu_dereference(), except that:
  
- #. The value returned by ``rcu_access_pointer()`` cannot be
+ #. The value returned by rcu_access_pointer() cannot be
     dereferenced. If you want to access the value pointed to as well as
-    the pointer itself, use ``rcu_dereference()`` instead of
-    ``rcu_access_pointer()``.
- #. The call to ``rcu_access_pointer()`` need not be protected. In
-    contrast, ``rcu_dereference()`` must either be within an RCU
+    the pointer itself, use rcu_dereference() instead of
+    rcu_access_pointer().
+ #. The call to rcu_access_pointer() need not be protected. In
+    contrast, rcu_dereference() must either be within an RCU
     read-side critical section or in a code segment where the pointer
     cannot change, for example, in code protected by the corresponding
     update-side lock.
  +-----------------------------------------------------------------------+
  | **Quick Quiz**:                                                       |
  +-----------------------------------------------------------------------+
- | Without the ``rcu_dereference()`` or the ``rcu_access_pointer()``,    |
+ | Without the rcu_dereference() or the rcu_access_pointer(),            |
  | what destructive optimizations might the compiler make use of?        |
  +-----------------------------------------------------------------------+
  | **Answer**:                                                           |
  +-----------------------------------------------------------------------+
- | Let's start with what happens to ``do_something_gp()`` if it fails to |
- | use ``rcu_dereference()``. It could reuse a value formerly fetched    |
+ | Let's start with what happens to do_something_gp() if it fails to     |
+ | use rcu_dereference(). It could reuse a value formerly fetched        |
  | from this same pointer. It could also fetch the pointer from ``gp``   |
  | in a byte-at-a-time manner, resulting in *load tearing*, in turn      |
  | resulting a bytewise mash-up of two distinct pointer values. It might |
  | update has changed the pointer to match the wrong guess. Too bad      |
  | about any dereferences that returned pre-initialization garbage in    |
  | the meantime!                                                         |
- | For ``remove_gp_synchronous()``, as long as all modifications to      |
+ | For remove_gp_synchronous(), as long as all modifications to          |
  | ``gp`` are carried out while holding ``gp_lock``, the above           |
  | optimizations are harmless. However, ``sparse`` will complain if you  |
  | define ``gp`` with ``__rcu`` and then access it without using either  |
- | ``rcu_access_pointer()`` or ``rcu_dereference()``.                    |
+ | rcu_access_pointer() or rcu_dereference().                            |
  +-----------------------------------------------------------------------+
  
  In short, RCU's publish-subscribe guarantee is provided by the
- combination of ``rcu_assign_pointer()`` and ``rcu_dereference()``. This
+ combination of rcu_assign_pointer() and rcu_dereference(). This
  guarantee allows data elements to be safely added to RCU-protected
  linked data structures without disrupting RCU readers. This guarantee
  can be used in combination with the grace-period guarantee to also allow
@@@ -462,9 -461,9 +461,9 @@@ again without disrupting RCU readers
  
  This guarantee was only partially premeditated. DYNIX/ptx used an
  explicit memory barrier for publication, but had nothing resembling
``rcu_dereference()`` for subscription, nor did it have anything
rcu_dereference() for subscription, nor did it have anything
  resembling the dependency-ordering barrier that was later subsumed
- into ``rcu_dereference()`` and later still into ``READ_ONCE()``. The
+ into rcu_dereference() and later still into READ_ONCE(). The
  need for these operations made itself known quite suddenly at a
  late-1990s meeting with the DEC Alpha architects, back in the days when
  DEC was still a free-standing company. It took the Alpha architects a
@@@ -474,7 -473,7 +473,7 @@@ documentation did not make this point c
  and C++ standards committees have provided much education on tricks and
  traps from the compiler. In short, compilers were much less tricky in
  the early 1990s, but in 2015, don't even think about omitting
``rcu_dereference()``!
rcu_dereference()!
  
  Memory-Barrier Guarantees
  ~~~~~~~~~~~~~~~~~~~~~~~~~
@@@ -484,31 -483,31 +483,31 @@@ demonstrates the need for RCU's stringe
  systems with more than one CPU:
  
  #. Each CPU that has an RCU read-side critical section that begins
-    before ``synchronize_rcu()`` starts is guaranteed to execute a full
+    before synchronize_rcu() starts is guaranteed to execute a full
     memory barrier between the time that the RCU read-side critical
-    section ends and the time that ``synchronize_rcu()`` returns. Without
+    section ends and the time that synchronize_rcu() returns. Without
     this guarantee, a pre-existing RCU read-side critical section might
     hold a reference to the newly removed ``struct foo`` after the
-    ``kfree()`` on line 14 of ``remove_gp_synchronous()``.
+    kfree() on line 14 of remove_gp_synchronous().
  #. Each CPU that has an RCU read-side critical section that ends after
-    ``synchronize_rcu()`` returns is guaranteed to execute a full memory
-    barrier between the time that ``synchronize_rcu()`` begins and the
+    synchronize_rcu() returns is guaranteed to execute a full memory
+    barrier between the time that synchronize_rcu() begins and the
     time that the RCU read-side critical section begins. Without this
     guarantee, a later RCU read-side critical section running after the
-    ``kfree()`` on line 14 of ``remove_gp_synchronous()`` might later run
-    ``do_something_gp()`` and find the newly deleted ``struct foo``.
- #. If the task invoking ``synchronize_rcu()`` remains on a given CPU,
+    kfree() on line 14 of remove_gp_synchronous() might later run
+    do_something_gp() and find the newly deleted ``struct foo``.
+ #. If the task invoking synchronize_rcu() remains on a given CPU,
     then that CPU is guaranteed to execute a full memory barrier sometime
-    during the execution of ``synchronize_rcu()``. This guarantee ensures
-    that the ``kfree()`` on line 14 of ``remove_gp_synchronous()`` really
+    during the execution of synchronize_rcu(). This guarantee ensures
+    that the kfree() on line 14 of remove_gp_synchronous() really
     does execute after the removal on line 11.
- #. If the task invoking ``synchronize_rcu()`` migrates among a group of
+ #. If the task invoking synchronize_rcu() migrates among a group of
     CPUs during that invocation, then each of the CPUs in that group is
     guaranteed to execute a full memory barrier sometime during the
-    execution of ``synchronize_rcu()``. This guarantee also ensures that
-    the ``kfree()`` on line 14 of ``remove_gp_synchronous()`` really does
+    execution of synchronize_rcu(). This guarantee also ensures that
+    the kfree() on line 14 of remove_gp_synchronous() really does
     execute after the removal on line 11, but also in the case where the
-    thread executing the ``synchronize_rcu()`` migrates in the meantime.
+    thread executing the synchronize_rcu() migrates in the meantime.
  
  +-----------------------------------------------------------------------+
  | **Quick Quiz**:                                                       |
  | Given that multiple CPUs can start RCU read-side critical sections at |
  | any time without any ordering whatsoever, how can RCU possibly tell   |
  | whether or not a given RCU read-side critical section starts before a |
- | given instance of ``synchronize_rcu()``?                              |
+ | given instance of synchronize_rcu()?                                  |
  +-----------------------------------------------------------------------+
  | **Answer**:                                                           |
  +-----------------------------------------------------------------------+
  | If RCU cannot tell whether or not a given RCU read-side critical      |
- | section starts before a given instance of ``synchronize_rcu()``, then |
+ | section starts before a given instance of synchronize_rcu(), then     |
  | it must assume that the RCU read-side critical section started first. |
- | In other words, a given instance of ``synchronize_rcu()`` can avoid   |
+ | In other words, a given instance of synchronize_rcu() can avoid       |
  | waiting on a given RCU read-side critical section only if it can      |
- | prove that ``synchronize_rcu()`` started first.                       |
- | A related question is “When ``rcu_read_lock()`` doesn't generate any  |
+ | prove that synchronize_rcu() started first.                           |
+ | A related question is “When rcu_read_lock() doesn't generate any      |
  | code, why does it matter how it relates to a grace period?” The       |
- | answer is that it is not the relationship of ``rcu_read_lock()``      |
+ | answer is that it is not the relationship of rcu_read_lock()          |
  | itself that is important, but rather the relationship of the code     |
  | within the enclosed RCU read-side critical section to the code        |
  | preceding and following the grace period. If we take this viewpoint,  |
  | Yes, they really are required. To see why the first guarantee is      |
  | required, consider the following sequence of events:                  |
  |                                                                       |
- | #. CPU 1: ``rcu_read_lock()``                                         |
+ | #. CPU 1: rcu_read_lock()                                             |
  | #. CPU 1: ``q = rcu_dereference(gp); /* Very likely to return p. */`` |
  | #. CPU 0: ``list_del_rcu(p);``                                        |
- | #. CPU 0: ``synchronize_rcu()`` starts.                               |
+ | #. CPU 0: synchronize_rcu() starts.                                   |
  | #. CPU 1: ``do_something_with(q->a);``                                |
  |    ``/* No smp_mb(), so might happen after kfree(). */``              |
- | #. CPU 1: ``rcu_read_unlock()``                                       |
- | #. CPU 0: ``synchronize_rcu()`` returns.                              |
+ | #. CPU 1: rcu_read_unlock()                                           |
+ | #. CPU 0: synchronize_rcu() returns.                                  |
  | #. CPU 0: ``kfree(p);``                                               |
  |                                                                       |
  | Therefore, there absolutely must be a full memory barrier between the |
  | is roughly similar:                                                   |
  |                                                                       |
  | #. CPU 0: ``list_del_rcu(p);``                                        |
- | #. CPU 0: ``synchronize_rcu()`` starts.                               |
- | #. CPU 1: ``rcu_read_lock()``                                         |
+ | #. CPU 0: synchronize_rcu() starts.                                   |
+ | #. CPU 1: rcu_read_lock()                                             |
  | #. CPU 1: ``q = rcu_dereference(gp);``                                |
  |    ``/* Might return p if no memory barrier. */``                     |
- | #. CPU 0: ``synchronize_rcu()`` returns.                              |
+ | #. CPU 0: synchronize_rcu() returns.                                  |
  | #. CPU 0: ``kfree(p);``                                               |
  | #. CPU 1: ``do_something_with(q->a); /* Boom!!! */``                  |
- | #. CPU 1: ``rcu_read_unlock()``                                       |
+ | #. CPU 1: rcu_read_unlock()                                           |
  |                                                                       |
  | And similarly, without a memory barrier between the beginning of the  |
  | grace period and the beginning of the RCU read-side critical section, |
  +-----------------------------------------------------------------------+
  | **Quick Quiz**:                                                       |
  +-----------------------------------------------------------------------+
- | You claim that ``rcu_read_lock()`` and ``rcu_read_unlock()`` generate |
+ | You claim that rcu_read_lock() and rcu_read_unlock() generate         |
  | absolutely no code in some kernel builds. This means that the         |
  | compiler might arbitrarily rearrange consecutive RCU read-side        |
  | critical sections. Given such rearrangement, if a given RCU read-side |
  +-----------------------------------------------------------------------+
  | **Answer**:                                                           |
  +-----------------------------------------------------------------------+
- | In cases where ``rcu_read_lock()`` and ``rcu_read_unlock()`` generate |
+ | In cases where rcu_read_lock() and rcu_read_unlock() generate         |
  | absolutely no code, RCU infers quiescent states only at special       |
  | locations, for example, within the scheduler. Because calls to        |
- | ``schedule()`` had better prevent calling-code accesses to shared     |
- | variables from being rearranged across the call to ``schedule()``, if |
+ | schedule() had better prevent calling-code accesses to shared         |
+ | variables from being rearranged across the call to schedule(), if     |
  | RCU detects the end of a given RCU read-side critical section, it     |
  | will necessarily detect the end of all prior RCU read-side critical   |
  | sections, no matter how aggressively the compiler scrambles the code. |
@@@ -655,8 -654,8 +654,8 @@@ read-side critical section might searc
  then might acquire the update-side spinlock in order to update that
  element, all while remaining in that RCU read-side critical section. Of
  course, it is necessary to exit the RCU read-side critical section
- before invoking ``synchronize_rcu()``, however, this inconvenience can
- be avoided through use of the ``call_rcu()`` and ``kfree_rcu()`` API
+ before invoking synchronize_rcu(), however, this inconvenience can
+ be avoided through use of the call_rcu() and kfree_rcu() API
  members described later in this document.
  
  +-----------------------------------------------------------------------+
@@@ -694,10 -693,10 +693,10 @@@ these non-guarantees were premeditated
  Readers Impose Minimal Ordering
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  
- Reader-side markers such as ``rcu_read_lock()`` and
``rcu_read_unlock()`` provide absolutely no ordering guarantees except
+ Reader-side markers such as rcu_read_lock() and
rcu_read_unlock() provide absolutely no ordering guarantees except
  through their interaction with the grace-period APIs such as
``synchronize_rcu()``. To see this, consider the following pair of
synchronize_rcu(). To see this, consider the following pair of
  threads:
  
     ::
        18   rcu_read_unlock();
        19 }
  
- After ``thread0()`` and ``thread1()`` execute concurrently, it is quite
+ After thread0() and thread1() execute concurrently, it is quite
  possible to have
  
     ::
        (r1 == 1 && r2 == 0)
  
  (that is, ``y`` appears to have been assigned before ``x``), which would
- not be possible if ``rcu_read_lock()`` and ``rcu_read_unlock()`` had
+ not be possible if rcu_read_lock() and rcu_read_unlock() had
  much in the way of ordering properties. But they do not, so the CPU is
  within its rights to do significant reordering. This is by design: Any
  significant ordering constraints would slow down these fast-path APIs.
  +-----------------------------------------------------------------------+
  | **Answer**:                                                           |
  +-----------------------------------------------------------------------+
- | No, the volatile casts in ``READ_ONCE()`` and ``WRITE_ONCE()``        |
+ | No, the volatile casts in READ_ONCE() and WRITE_ONCE()                |
  | prevent the compiler from reordering in this particular case.         |
  +-----------------------------------------------------------------------+
  
  Readers Do Not Exclude Updaters
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  
- Neither ``rcu_read_lock()`` nor ``rcu_read_unlock()`` exclude updates.
+ Neither rcu_read_lock() nor rcu_read_unlock() exclude updates.
  All they do is to prevent grace periods from ending. The following
  example illustrates this:
  
        18   spin_unlock(&my_lock);
        19 }
  
- If the ``thread0()`` function's ``rcu_read_lock()`` excluded the
``thread1()`` function's update, the ``WARN_ON()`` could never fire. But
- the fact is that ``rcu_read_lock()`` does not exclude much of anything
- aside from subsequent grace periods, of which ``thread1()`` has none, so
- the ``WARN_ON()`` can and does fire.
+ If the thread0() function's rcu_read_lock() excluded the
thread1() function's update, the WARN_ON() could never fire. But
+ the fact is that rcu_read_lock() does not exclude much of anything
+ aside from subsequent grace periods, of which thread1() has none, so
+ the WARN_ON() can and does fire.
  
  Updaters Only Wait For Old Readers
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  
- It might be tempting to assume that after ``synchronize_rcu()``
+ It might be tempting to assume that after synchronize_rcu()
  completes, there are no readers executing. This temptation must be
  avoided because new readers can start immediately after
``synchronize_rcu()`` starts, and ``synchronize_rcu()`` is under no
synchronize_rcu() starts, and synchronize_rcu() is under no
  obligation to wait for these new readers.
  
  +-----------------------------------------------------------------------+
  +-----------------------------------------------------------------------+
  | **Answer**:                                                           |
  +-----------------------------------------------------------------------+
- | For no time at all. Even if ``synchronize_rcu()`` were to wait until  |
+ | For no time at all. Even if synchronize_rcu() were to wait until      |
  | all readers had completed, a new reader might start immediately after |
- | ``synchronize_rcu()`` completed. Therefore, the code following        |
- | ``synchronize_rcu()`` can *never* rely on there being no readers.     |
+ | synchronize_rcu() completed. Therefore, the code following            |
+ | synchronize_rcu() can *never* rely on there being no readers.         |
  +-----------------------------------------------------------------------+
  
  Grace Periods Don't Partition Read-Side Critical Sections
@@@ -892,12 -891,12 +891,12 @@@ period is known to end before the secon
        28   rcu_read_unlock();
        29 }
  
- Here, if ``(r1 == 1)``, then ``thread0()``'s write to ``b`` must happen
- before the end of ``thread1()``'s grace period. If in addition
- ``(r4 == 1)``, then ``thread3()``'s read from ``b`` must happen after
- the beginning of ``thread2()``'s grace period. If it is also the case
- that ``(r2 == 1)``, then the end of ``thread1()``'s grace period must
- precede the beginning of ``thread2()``'s grace period. This mean that
+ Here, if ``(r1 == 1)``, then thread0()'s write to ``b`` must happen
+ before the end of thread1()'s grace period. If in addition
+ ``(r4 == 1)``, then thread3()'s read from ``b`` must happen after
+ the beginning of thread2()'s grace period. If it is also the case
+ that ``(r2 == 1)``, then the end of thread1()'s grace period must
+ precede the beginning of thread2()'s grace period. This mean that
  the two RCU read-side critical sections cannot overlap, guaranteeing
  that ``(r3 == 1)``. As a result, the outcome:
  
@@@ -1076,8 -1075,8 +1075,8 @@@ is captured by the following list of si
     b. Wait-free read-side primitives for real-time use.
  
  This focus on read-mostly situations means that RCU must interoperate
- with other synchronization primitives. For example, the ``add_gp()`` and
``remove_gp_synchronous()`` examples discussed earlier use RCU to
+ with other synchronization primitives. For example, the add_gp() and
remove_gp_synchronous() examples discussed earlier use RCU to
  protect readers and locking to coordinate updaters. However, the need
  extends much farther, requiring that a variety of synchronization
  primitives be legal within RCU read-side critical sections, including
@@@ -1096,7 -1095,7 +1095,7 @@@ memory barriers
  | case, voluntary context switch) within an RCU read-side critical      |
  | section. However, sleeping locks may be used within userspace RCU     |
  | read-side critical sections, and also within Linux-kernel sleepable   |
 -| RCU `(SRCU) <#Sleepable%20RCU>`__ read-side critical sections. In     |
 +| RCU `(SRCU) <Sleepable RCU_>`__ read-side critical sections. In       |
  | addition, the -rt patchset turns spinlocks into a sleeping locks so   |
  | that the corresponding critical sections can be preempted, which also |
  | means that these sleeplockified spinlocks (but not other sleeping     |
  | sections.                                                             |
  | Note that it *is* legal for a normal RCU read-side critical section   |
  | to conditionally acquire a sleeping locks (as in                      |
- | ``mutex_trylock()``), but only as long as it does not loop            |
+ | mutex_trylock()), but only as long as it does not loop                |
  | indefinitely attempting to conditionally acquire that sleeping locks. |
- | The key point is that things like ``mutex_trylock()`` either return   |
+ | The key point is that things like mutex_trylock() either return       |
  | with the mutex held, or return an error indication if the mutex was   |
- | not immediately available. Either way, ``mutex_trylock()`` returns    |
+ | not immediately available. Either way, mutex_trylock() returns        |
  | immediately without sleeping.                                         |
  +-----------------------------------------------------------------------+
  
@@@ -1182,66 -1181,66 +1181,66 @@@ and has become decreasingly so as memor
  costs have plummeted. However, as I learned from Matt Mackall's
  `bloatwatch <http://elinux.org/Linux_Tiny-FAQ>`__ efforts, memory
  footprint is critically important on single-CPU systems with
- non-preemptible (``CONFIG_PREEMPT=n``) kernels, and thus `tiny
- RCU <https://lkml.kernel.org/g/[email protected]>`__
+ non-preemptible (``CONFIG_PREEMPTION=n``) kernels, and thus `tiny
+ RCU <https://lore.kernel.org/r/[email protected]>`__
  was born. Josh Triplett has since taken over the small-memory banner
  with his `Linux kernel tinification <https://tiny.wiki.kernel.org/>`__
 -project, which resulted in `SRCU <#Sleepable%20RCU>`__ becoming optional
 +project, which resulted in `SRCU <Sleepable RCU_>`__ becoming optional
  for those kernels not needing it.
  
  The remaining performance requirements are, for the most part,
  unsurprising. For example, in keeping with RCU's read-side
- specialization, ``rcu_dereference()`` should have negligible overhead
+ specialization, rcu_dereference() should have negligible overhead
  (for example, suppression of a few minor compiler optimizations).
- Similarly, in non-preemptible environments, ``rcu_read_lock()`` and
``rcu_read_unlock()`` should have exactly zero overhead.
+ Similarly, in non-preemptible environments, rcu_read_lock() and
rcu_read_unlock() should have exactly zero overhead.
  
  In preemptible environments, in the case where the RCU read-side
  critical section was not preempted (as will be the case for the
- highest-priority real-time process), ``rcu_read_lock()`` and
``rcu_read_unlock()`` should have minimal overhead. In particular, they
+ highest-priority real-time process), rcu_read_lock() and
rcu_read_unlock() should have minimal overhead. In particular, they
  should not contain atomic read-modify-write operations, memory-barrier
  instructions, preemption disabling, interrupt disabling, or backwards
  branches. However, in the case where the RCU read-side critical section
- was preempted, ``rcu_read_unlock()`` may acquire spinlocks and disable
+ was preempted, rcu_read_unlock() may acquire spinlocks and disable
  interrupts. This is why it is better to nest an RCU read-side critical
  section within a preempt-disable region than vice versa, at least in
  cases where that critical section is short enough to avoid unduly
  degrading real-time latencies.
  
- The ``synchronize_rcu()`` grace-period-wait primitive is optimized for
+ The synchronize_rcu() grace-period-wait primitive is optimized for
  throughput. It may therefore incur several milliseconds of latency in
  addition to the duration of the longest RCU read-side critical section.
  On the other hand, multiple concurrent invocations of
``synchronize_rcu()`` are required to use batching optimizations so that
synchronize_rcu() are required to use batching optimizations so that
  they can be satisfied by a single underlying grace-period-wait
  operation. For example, in the Linux kernel, it is not unusual for a
  single grace-period-wait operation to serve more than `1,000 separate
  invocations <https://www.usenix.org/conference/2004-usenix-annual-technical-conference/making-rcu-safe-deep-sub-millisecond-response>`__
- of ``synchronize_rcu()``, thus amortizing the per-invocation overhead
+ of synchronize_rcu(), thus amortizing the per-invocation overhead
  down to nearly zero. However, the grace-period optimization is also
  required to avoid measurable degradation of real-time scheduling and
  interrupt latencies.
  
- In some cases, the multi-millisecond ``synchronize_rcu()`` latencies are
- unacceptable. In these cases, ``synchronize_rcu_expedited()`` may be
+ In some cases, the multi-millisecond synchronize_rcu() latencies are
+ unacceptable. In these cases, synchronize_rcu_expedited() may be
  used instead, reducing the grace-period latency down to a few tens of
  microseconds on small systems, at least in cases where the RCU read-side
  critical sections are short. There are currently no special latency
- requirements for ``synchronize_rcu_expedited()`` on large systems, but,
+ requirements for synchronize_rcu_expedited() on large systems, but,
  consistent with the empirical nature of the RCU specification, that is
  subject to change. However, there most definitely are scalability
- requirements: A storm of ``synchronize_rcu_expedited()`` invocations on
+ requirements: A storm of synchronize_rcu_expedited() invocations on
  4096 CPUs should at least make reasonable forward progress. In return
- for its shorter latencies, ``synchronize_rcu_expedited()`` is permitted
+ for its shorter latencies, synchronize_rcu_expedited() is permitted
  to impose modest degradation of real-time latency on non-idle online
  CPUs. Here, “modest” means roughly the same latency degradation as a
  scheduling-clock interrupt.
  
  There are a number of situations where even
``synchronize_rcu_expedited()``'s reduced grace-period latency is
- unacceptable. In these situations, the asynchronous ``call_rcu()`` can
- be used in place of ``synchronize_rcu()`` as follows:
synchronize_rcu_expedited()'s reduced grace-period latency is
+ unacceptable. In these situations, the asynchronous call_rcu() can
+ be used in place of synchronize_rcu() as follows:
  
     ::
  
        28 }
  
  A definition of ``struct foo`` is finally needed, and appears on
- lines 1-5. The function ``remove_gp_cb()`` is passed to ``call_rcu()``
+ lines 1-5. The function remove_gp_cb() is passed to call_rcu()
  on line 25, and will be invoked after the end of a subsequent grace
- period. This gets the same effect as ``remove_gp_synchronous()``, but
+ period. This gets the same effect as remove_gp_synchronous(), but
  without forcing the updater to wait for a grace period to elapse. The
``call_rcu()`` function may be used in a number of situations where
- neither ``synchronize_rcu()`` nor ``synchronize_rcu_expedited()`` would
- be legal, including within preempt-disable code, ``local_bh_disable()``
call_rcu() function may be used in a number of situations where
+ neither synchronize_rcu() nor synchronize_rcu_expedited() would
+ be legal, including within preempt-disable code, local_bh_disable()
  code, interrupt-disable code, and interrupt handlers. However, even
``call_rcu()`` is illegal within NMI handlers and from idle and offline
- CPUs. The callback function (``remove_gp_cb()`` in this case) will be
call_rcu() is illegal within NMI handlers and from idle and offline
+ CPUs. The callback function (remove_gp_cb() in this case) will be
  executed within softirq (software interrupt) environment within the
  Linux kernel, either within a real softirq handler or under the
- protection of ``local_bh_disable()``. In both the Linux kernel and in
+ protection of local_bh_disable(). In both the Linux kernel and in
  userspace, it is bad practice to write an RCU callback function that
  takes too long. Long-running operations should be relegated to separate
  threads or (in the Linux kernel) workqueues.
  +-----------------------------------------------------------------------+
  | **Quick Quiz**:                                                       |
  +-----------------------------------------------------------------------+
- | Why does line 19 use ``rcu_access_pointer()``? After all,             |
- | ``call_rcu()`` on line 25 stores into the structure, which would      |
+ | Why does line 19 use rcu_access_pointer()? After all,                 |
+ | call_rcu() on line 25 stores into the structure, which would          |
  | interact badly with concurrent insertions. Doesn't this mean that     |
- | ``rcu_dereference()`` is required?                                    |
+ | rcu_dereference() is required?                                        |
  +-----------------------------------------------------------------------+
  | **Answer**:                                                           |
  +-----------------------------------------------------------------------+
  | Presumably the ``->gp_lock`` acquired on line 18 excludes any         |
- | changes, including any insertions that ``rcu_dereference()`` would    |
+ | changes, including any insertions that rcu_dereference() would        |
  | protect against. Therefore, any insertions will be delayed until      |
  | after ``->gp_lock`` is released on line 25, which in turn means that  |
- | ``rcu_access_pointer()`` suffices.                                    |
+ | rcu_access_pointer() suffices.                                        |
  +-----------------------------------------------------------------------+
  
- However, all that ``remove_gp_cb()`` is doing is invoking ``kfree()`` on
+ However, all that remove_gp_cb() is doing is invoking kfree() on
  the data element. This is a common idiom, and is supported by
``kfree_rcu()``, which allows “fire and forget” operation as shown
kfree_rcu(), which allows “fire and forget” operation as shown
  below:
  
     ::
        20   return true;
        21 }
  
- Note that ``remove_gp_faf()`` simply invokes ``kfree_rcu()`` and
+ Note that remove_gp_faf() simply invokes kfree_rcu() and
  proceeds, without any need to pay any further attention to the
- subsequent grace period and ``kfree()``. It is permissible to invoke
``kfree_rcu()`` from the same environments as for ``call_rcu()``.
- Interestingly enough, DYNIX/ptx had the equivalents of ``call_rcu()``
- and ``kfree_rcu()``, but not ``synchronize_rcu()``. This was due to the
+ subsequent grace period and kfree(). It is permissible to invoke
kfree_rcu() from the same environments as for call_rcu().
+ Interestingly enough, DYNIX/ptx had the equivalents of call_rcu()
+ and kfree_rcu(), but not synchronize_rcu(). This was due to the
  fact that RCU was not heavily used within DYNIX/ptx, so the very few
- places that needed something like ``synchronize_rcu()`` simply
+ places that needed something like synchronize_rcu() simply
  open-coded it.
  
  +-----------------------------------------------------------------------+
  | **Quick Quiz**:                                                       |
  +-----------------------------------------------------------------------+
- | Earlier it was claimed that ``call_rcu()`` and ``kfree_rcu()``        |
+ | Earlier it was claimed that call_rcu() and kfree_rcu()                |
  | allowed updaters to avoid being blocked by readers. But how can that  |
  | be correct, given that the invocation of the callback and the freeing |
  | of the memory (respectively) must still wait for a grace period to    |
  | definition would say that updates in garbage-collected languages      |
  | cannot complete until the next time the garbage collector runs, which |
  | does not seem at all reasonable. The key point is that in most cases, |
- | an updater using either ``call_rcu()`` or ``kfree_rcu()`` can proceed |
- | to the next update as soon as it has invoked ``call_rcu()`` or        |
- | ``kfree_rcu()``, without having to wait for a subsequent grace        |
+ | an updater using either call_rcu() or kfree_rcu() can proceed         |
+ | to the next update as soon as it has invoked call_rcu() or            |
+ | kfree_rcu(), without having to wait for a subsequent grace            |
  | period.                                                               |
  +-----------------------------------------------------------------------+
  
  But what if the updater must wait for the completion of code to be
  executed after the end of the grace period, but has other tasks that can
  be carried out in the meantime? The polling-style
``get_state_synchronize_rcu()`` and ``cond_synchronize_rcu()`` functions
get_state_synchronize_rcu() and cond_synchronize_rcu() functions
  may be used for this purpose, as shown below:
  
     ::
        18   return true;
        19 }
  
- On line 14, ``get_state_synchronize_rcu()`` obtains a “cookie” from RCU,
+ On line 14, get_state_synchronize_rcu() obtains a “cookie” from RCU,
  then line 15 carries out other tasks, and finally, line 16 returns
  immediately if a grace period has elapsed in the meantime, but otherwise
  waits as required. The need for ``get_state_synchronize_rcu`` and
``cond_synchronize_rcu()`` has appeared quite recently, so it is too
cond_synchronize_rcu() has appeared quite recently, so it is too
  early to tell whether they will stand the test of time.
  
  RCU thus provides a range of tools to allow updaters to strike the
@@@ -1421,8 -1420,8 +1420,8 @@@ example, an infinite loop in an RCU rea
  definition prevent later grace periods from ever completing. For a more
  involved example, consider a 64-CPU system built with
  ``CONFIG_RCU_NOCB_CPU=y`` and booted with ``rcu_nocbs=1-63``, where
- CPUs 1 through 63 spin in tight loops that invoke ``call_rcu()``. Even
- if these tight loops also contain calls to ``cond_resched()`` (thus
+ CPUs 1 through 63 spin in tight loops that invoke call_rcu(). Even
+ if these tight loops also contain calls to cond_resched() (thus
  allowing grace periods to complete), CPU 0 simply will not be able to
  invoke callbacks as fast as the other 63 CPUs can register them, at
  least not until the system runs out of memory. In both of these
@@@ -1435,21 -1434,21 +1434,21 @@@ RCU takes the following steps to encour
  periods:
  
  #. If a grace period fails to complete within 100 milliseconds, RCU
-    causes future invocations of ``cond_resched()`` on the holdout CPUs
+    causes future invocations of cond_resched() on the holdout CPUs
     to provide an RCU quiescent state. RCU also causes those CPUs'
-    ``need_resched()`` invocations to return ``true``, but only after the
+    need_resched() invocations to return ``true``, but only after the
     corresponding CPU's next scheduling-clock.
  #. CPUs mentioned in the ``nohz_full`` kernel boot parameter can run
     indefinitely in the kernel without scheduling-clock interrupts, which
-    defeats the above ``need_resched()`` strategem. RCU will therefore
-    invoke ``resched_cpu()`` on any ``nohz_full`` CPUs still holding out
+    defeats the above need_resched() strategem. RCU will therefore
+    invoke resched_cpu() on any ``nohz_full`` CPUs still holding out
     after 109 milliseconds.
  #. In kernels built with ``CONFIG_RCU_BOOST=y``, if a given task that
     has been preempted within an RCU read-side critical section is
     holding out for more than 500 milliseconds, RCU will resort to
     priority boosting.
  #. If a CPU is still holding out 10 seconds into the grace period, RCU
-    will invoke ``resched_cpu()`` on it regardless of its ``nohz_full``
+    will invoke resched_cpu() on it regardless of its ``nohz_full``
     state.
  
  The above values are defaults for systems running with ``HZ=1000``. They
@@@ -1457,10 -1456,10 +1456,10 @@@ will vary as the value of ``HZ`` varies
  the relevant Kconfig options and kernel boot parameters. RCU currently
  does not do much sanity checking of these parameters, so please use
  caution when changing them. Note that these forward-progress measures
 -are provided only for RCU, not for `SRCU <#Sleepable%20RCU>`__ or `Tasks
 -RCU <#Tasks%20RCU>`__.
 +are provided only for RCU, not for `SRCU <Sleepable RCU_>`__ or `Tasks
 +RCU`_.
  
- RCU takes the following steps in ``call_rcu()`` to encourage timely
+ RCU takes the following steps in call_rcu() to encourage timely
  invocation of callbacks when any given non-\ ``rcu_nocbs`` CPU has
  10,000 callbacks, or has 10,000 more callbacks than it had the last time
  encouragement was provided:
  
  Again, these are default values when running at ``HZ=1000``, and can be
  overridden. Again, these forward-progress measures are provided only for
 -RCU, not for `SRCU <#Sleepable%20RCU>`__ or `Tasks
 -RCU <#Tasks%20RCU>`__. Even for RCU, callback-invocation forward
 +RCU, not for `SRCU <Sleepable RCU_>`__ or `Tasks
 +RCU`_. Even for RCU, callback-invocation forward
  progress for ``rcu_nocbs`` CPUs is much less well-developed, in part
  because workloads benefiting from ``rcu_nocbs`` CPUs tend to invoke
``call_rcu()`` relatively infrequently. If workloads emerge that need
- both ``rcu_nocbs`` CPUs and high ``call_rcu()`` invocation rates, then
call_rcu() relatively infrequently. If workloads emerge that need
+ both ``rcu_nocbs`` CPUs and high call_rcu() invocation rates, then
  additional forward-progress work will be required.
  
  Composability
@@@ -1496,11 -1495,11 +1495,11 @@@ in fact may be nested arbitrarily deepl
  real-world implementations of composable constructs, there are
  limitations.
  
- Implementations of RCU for which ``rcu_read_lock()`` and
``rcu_read_unlock()`` generate no code, such as Linux-kernel RCU when
- ``CONFIG_PREEMPT=n``, can be nested arbitrarily deeply. After all, there
+ Implementations of RCU for which rcu_read_lock() and
rcu_read_unlock() generate no code, such as Linux-kernel RCU when
+ ``CONFIG_PREEMPTION=n``, can be nested arbitrarily deeply. After all, there
  is no overhead. Except that if all these instances of
``rcu_read_lock()`` and ``rcu_read_unlock()`` are visible to the
rcu_read_lock() and rcu_read_unlock() are visible to the
  compiler, compilation will eventually fail due to exhausting memory,
  mass storage, or user patience, whichever comes first. If the nesting is
  not visible to the compiler, as is the case with mutually recursive
@@@ -1558,11 -1557,11 +1557,11 @@@ argue that such workloads should instea
  the fact remains that RCU must handle such workloads gracefully. This
  requirement is another factor driving batching of grace periods, but it
  is also the driving force behind the checks for large numbers of queued
- RCU callbacks in the ``call_rcu()`` code path. Finally, high update
+ RCU callbacks in the call_rcu() code path. Finally, high update
  rates should not delay RCU read-side critical sections, although some
  small read-side delays can occur when using
``synchronize_rcu_expedited()``, courtesy of this function's use of
``smp_call_function_single()``.
synchronize_rcu_expedited(), courtesy of this function's use of
smp_call_function_single().
  
  Although all three of these corner cases were understood in the early
  1990s, a simple user-level test consisting of ``close(open(path))`` in a
@@@ -1583,48 -1582,48 +1582,48 @@@ Software-Engineering Requirement
  Between Murphy's Law and “To err is human”, it is necessary to guard
  against mishaps and misuse:
  
- #. It is all too easy to forget to use ``rcu_read_lock()`` everywhere
+ #. It is all too easy to forget to use rcu_read_lock() everywhere
     that it is needed, so kernels built with ``CONFIG_PROVE_RCU=y`` will
-    splat if ``rcu_dereference()`` is used outside of an RCU read-side
+    splat if rcu_dereference() is used outside of an RCU read-side
     critical section. Update-side code can use
-    ``rcu_dereference_protected()``, which takes a `lockdep
+    rcu_dereference_protected(), which takes a `lockdep
     expression <https://lwn.net/Articles/371986/>`__ to indicate what is
     providing the protection. If the indicated protection is not
     provided, a lockdep splat is emitted.
     Code shared between readers and updaters can use
-    ``rcu_dereference_check()``, which also takes a lockdep expression,
-    and emits a lockdep splat if neither ``rcu_read_lock()`` nor the
+    rcu_dereference_check(), which also takes a lockdep expression,
+    and emits a lockdep splat if neither rcu_read_lock() nor the
     indicated protection is in place. In addition,
-    ``rcu_dereference_raw()`` is used in those (hopefully rare) cases
+    rcu_dereference_raw() is used in those (hopefully rare) cases
     where the required protection cannot be easily described. Finally,
-    ``rcu_read_lock_held()`` is provided to allow a function to verify
+    rcu_read_lock_held() is provided to allow a function to verify
     that it has been invoked within an RCU read-side critical section. I
     was made aware of this set of requirements shortly after Thomas
     Gleixner audited a number of RCU uses.
  #. A given function might wish to check for RCU-related preconditions
     upon entry, before using any other RCU API. The
-    ``rcu_lockdep_assert()`` does this job, asserting the expression in
+    rcu_lockdep_assert() does this job, asserting the expression in
     kernels having lockdep enabled and doing nothing otherwise.
- #. It is also easy to forget to use ``rcu_assign_pointer()`` and
-    ``rcu_dereference()``, perhaps (incorrectly) substituting a simple
+ #. It is also easy to forget to use rcu_assign_pointer() and
+    rcu_dereference(), perhaps (incorrectly) substituting a simple
     assignment. To catch this sort of error, a given RCU-protected
     pointer may be tagged with ``__rcu``, after which sparse will
     complain about simple-assignment accesses to that pointer. Arnd
     Bergmann made me aware of this requirement, and also supplied the
     needed `patch series <https://lwn.net/Articles/376011/>`__.
  #. Kernels built with ``CONFIG_DEBUG_OBJECTS_RCU_HEAD=y`` will splat if
-    a data element is passed to ``call_rcu()`` twice in a row, without a
+    a data element is passed to call_rcu() twice in a row, without a
     grace period in between. (This error is similar to a double free.)
     The corresponding ``rcu_head`` structures that are dynamically
     allocated are automatically tracked, but ``rcu_head`` structures
     allocated on the stack must be initialized with
-    ``init_rcu_head_on_stack()`` and cleaned up with
-    ``destroy_rcu_head_on_stack()``. Similarly, statically allocated
+    init_rcu_head_on_stack() and cleaned up with
+    destroy_rcu_head_on_stack(). Similarly, statically allocated
     non-stack ``rcu_head`` structures must be initialized with
-    ``init_rcu_head()`` and cleaned up with ``destroy_rcu_head()``.
+    init_rcu_head() and cleaned up with destroy_rcu_head().
     Mathieu Desnoyers made me aware of this requirement, and also
     supplied the needed
-    `patch <https://lkml.kernel.org/g/20100319013024.GA28456@Krystal>`__.
+    `patch <https://lore.kernel.org/r/20100319013024.GA28456@Krystal>`__.
  #. An infinite loop in an RCU read-side critical section will eventually
     trigger an RCU CPU stall warning splat, with the duration of
     “eventually” being controlled by the ``RCU_CPU_STALL_TIMEOUT``
     ``rcupdate.rcu_cpu_stall_suppress`` to suppress the splats. This
     kernel parameter may also be set via ``sysfs``. Furthermore, RCU CPU
     stall warnings are counter-productive during sysrq dumps and during
-    panics. RCU therefore supplies the ``rcu_sysrq_start()`` and
-    ``rcu_sysrq_end()`` API members to be called before and after long
-    sysrq dumps. RCU also supplies the ``rcu_panic()`` notifier that is
+    panics. RCU therefore supplies the rcu_sysrq_start() and
+    rcu_sysrq_end() API members to be called before and after long
+    sysrq dumps. RCU also supplies the rcu_panic() notifier that is
     automatically invoked at the beginning of a panic to suppress further
     RCU CPU stall warnings.
  
     synchronization mechanism, for example, reference counting.
  #. In kernels built with ``CONFIG_RCU_TRACE=y``, RCU-related information
     is provided via event tracing.
- #. Open-coded use of ``rcu_assign_pointer()`` and ``rcu_dereference()``
+ #. Open-coded use of rcu_assign_pointer() and rcu_dereference()
     to create typical linked data structures can be surprisingly
     error-prone. Therefore, RCU-protected `linked
     lists <https://lwn.net/Articles/609973/#RCU%20List%20APIs>`__ and,
     other special-purpose RCU-protected data structures are available in
     the Linux kernel and the userspace RCU library.
  #. Some linked structures are created at compile time, but still require
-    ``__rcu`` checking. The ``RCU_POINTER_INITIALIZER()`` macro serves
+    ``__rcu`` checking. The RCU_POINTER_INITIALIZER() macro serves
     this purpose.
- #. It is not necessary to use ``rcu_assign_pointer()`` when creating
+ #. It is not necessary to use rcu_assign_pointer() when creating
     linked structures that are to be published via a single external
-    pointer. The ``RCU_INIT_POINTER()`` macro is provided for this task
-    and also for assigning ``NULL`` pointers at runtime.
+    pointer. The RCU_INIT_POINTER() macro is provided for this task.
  
  This not a hard-and-fast list: RCU's diagnostic capabilities will
  continue to be guided by the number and type of usage bugs found in
@@@ -1716,7 -1714,7 +1714,7 @@@ requires almost all of them be hidden b
  
  This all should be quite obvious, but the fact remains that Linus
  Torvalds recently had to
- `remind <https://lkml.kernel.org/g/CA+55aFy4wcCwaL4okTs8wXhGZ5h-ibecy_Meg9C4MNQrUnwMcg@mail.gmail.com>`__
+ `remind <https://lore.kernel.org/r/CA+55aFy4wcCwaL4okTs8wXhGZ5h-ibecy_Meg9C4MNQrUnwMcg@mail.gmail.com>`__
  me of this requirement.
  
  Firmware Interface
@@@ -1743,17 -1741,17 +1741,17 @@@ Early Boo
  ~~~~~~~~~~
  
  The Linux kernel's boot sequence is an interesting process, and RCU is
- used early, even before ``rcu_init()`` is invoked. In fact, a number of
+ used early, even before rcu_init() is invoked. In fact, a number of
  RCU's primitives can be used as soon as the initial task's
  ``task_struct`` is available and the boot CPU's per-CPU variables are
- set up. The read-side primitives (``rcu_read_lock()``,
``rcu_read_unlock()``, ``rcu_dereference()``, and
``rcu_access_pointer()``) will operate normally very early on, as will
``rcu_assign_pointer()``.
+ set up. The read-side primitives (rcu_read_lock(),
rcu_read_unlock(), rcu_dereference(), and
rcu_access_pointer()) will operate normally very early on, as will
rcu_assign_pointer().
  
- Although ``call_rcu()`` may be invoked at any time during boot,
+ Although call_rcu() may be invoked at any time during boot,
  callbacks are not guaranteed to be invoked until after all of RCU's
- kthreads have been spawned, which occurs at ``early_initcall()`` time.
+ kthreads have been spawned, which occurs at early_initcall() time.
  This delay in callback invocation is due to the fact that RCU does not
  invoke callbacks until it is fully initialized, and this full
  initialization cannot occur until after the scheduler has initialized
@@@ -1762,22 -1760,22 +1760,22 @@@ it would be possible to invoke callback
  panacea because there would be severe restrictions on what operations
  those callbacks could invoke.
  
- Perhaps surprisingly, ``synchronize_rcu()`` and
``synchronize_rcu_expedited()``, will operate normally during very early
+ Perhaps surprisingly, synchronize_rcu() and
synchronize_rcu_expedited(), will operate normally during very early
  boot, the reason being that there is only one CPU and preemption is
- disabled. This means that the call ``synchronize_rcu()`` (or friends)
+ disabled. This means that the call synchronize_rcu() (or friends)
  itself is a quiescent state and thus a grace period, so the early-boot
  implementation can be a no-op.
  
  However, once the scheduler has spawned its first kthread, this early
- boot trick fails for ``synchronize_rcu()`` (as well as for
``synchronize_rcu_expedited()``) in ``CONFIG_PREEMPT=y`` kernels. The
+ boot trick fails for synchronize_rcu() (as well as for
synchronize_rcu_expedited()) in ``CONFIG_PREEMPTION=y`` kernels. The
  reason is that an RCU read-side critical section might be preempted,
- which means that a subsequent ``synchronize_rcu()`` really does have to
+ which means that a subsequent synchronize_rcu() really does have to
  wait for something, as opposed to simply returning immediately.
- Unfortunately, ``synchronize_rcu()`` can't do this until all of its
+ Unfortunately, synchronize_rcu() can't do this until all of its
  kthreads are spawned, which doesn't happen until some time during
``early_initcalls()`` time. But this is no excuse: RCU is nevertheless
early_initcalls() time. But this is no excuse: RCU is nevertheless
  required to correctly handle synchronous grace periods during this time
  period. Once all of its kthreads are up and running, RCU starts running
  normally.
@@@ -1820,7 -1818,7 +1818,7 @@@ Interrupts and NMI
  
  The Linux kernel has interrupts, and RCU read-side critical sections are
  legal within interrupt handlers and within interrupt-disabled regions of
- code, as are invocations of ``call_rcu()``.
+ code, as are invocations of call_rcu().
  
  Some Linux-kernel architectures can enter an interrupt handler from
  non-idle process context, and then just never leave it, instead
@@@ -1832,22 -1830,22 +1830,22 @@@ way during a rewrite of RCU's dyntick-i
  
  The Linux kernel has non-maskable interrupts (NMIs), and RCU read-side
  critical sections are legal within NMI handlers. Thankfully, RCU
- update-side primitives, including ``call_rcu()``, are prohibited within
+ update-side primitives, including call_rcu(), are prohibited within
  NMI handlers.
  
  The name notwithstanding, some Linux-kernel architectures can have
  nested NMIs, which RCU must handle correctly. Andy Lutomirski `surprised
- me <https://lkml.kernel.org/r/CALCETrXLq1y7e_dKFPgou-FKHB6Pu-r8+t-6Ds+8=va7anBWDA@mail.gmail.com>`__
+ me <https://lore.kernel.org/r/CALCETrXLq1y7e_dKFPgou-FKHB6Pu-r8+t-6Ds+8=va7anBWDA@mail.gmail.com>`__
  with this requirement; he also kindly surprised me with `an
- algorithm <https://lkml.kernel.org/r/CALCETrXSY9JpW3uE6H8WYk81sg56qasA2aqmjMPsq5dOtzso=g@mail.gmail.com>`__
+ algorithm <https://lore.kernel.org/r/CALCETrXSY9JpW3uE6H8WYk81sg56qasA2aqmjMPsq5dOtzso=g@mail.gmail.com>`__
  that meets this requirement.
  
  Furthermore, NMI handlers can be interrupted by what appear to RCU to be
  normal interrupts. One way that this can happen is for code that
- directly invokes ``rcu_irq_enter()`` and ``rcu_irq_exit()`` to be called
+ directly invokes rcu_irq_enter() and rcu_irq_exit() to be called
  from an NMI handler. This astonishing fact of life prompted the current
- code structure, which has ``rcu_irq_enter()`` invoking
``rcu_nmi_enter()`` and ``rcu_irq_exit()`` invoking ``rcu_nmi_exit()``.
+ code structure, which has rcu_irq_enter() invoking
rcu_nmi_enter() and rcu_irq_exit() invoking rcu_nmi_exit().
  And yes, I also learned of this requirement the hard way.
  
  Loadable Modules
@@@ -1857,45 -1855,45 +1855,45 @@@ The Linux kernel has loadable modules, 
  unloaded. After a given module has been unloaded, any attempt to call
  one of its functions results in a segmentation fault. The module-unload
  functions must therefore cancel any delayed calls to loadable-module
- functions, for example, any outstanding ``mod_timer()`` must be dealt
- with via ``del_timer_sync()`` or similar.
+ functions, for example, any outstanding mod_timer() must be dealt
+ with via del_timer_sync() or similar.
  
  Unfortunately, there is no way to cancel an RCU callback; once you
- invoke ``call_rcu()``, the callback function is eventually going to be
+ invoke call_rcu(), the callback function is eventually going to be
  invoked, unless the system goes down first. Because it is normally
  considered socially irresponsible to crash the system in response to a
  module unload request, we need some other way to deal with in-flight RCU
  callbacks.
  
- RCU therefore provides ``rcu_barrier()``, which waits until all
+ RCU therefore provides rcu_barrier(), which waits until all
  in-flight RCU callbacks have been invoked. If a module uses
``call_rcu()``, its exit function should therefore prevent any future
- invocation of ``call_rcu()``, then invoke ``rcu_barrier()``. In theory,
- the underlying module-unload code could invoke ``rcu_barrier()``
call_rcu(), its exit function should therefore prevent any future
+ invocation of call_rcu(), then invoke rcu_barrier(). In theory,
+ the underlying module-unload code could invoke rcu_barrier()
  unconditionally, but in practice this would incur unacceptable
  latencies.
  
  Nikita Danilov noted this requirement for an analogous
  filesystem-unmount situation, and Dipankar Sarma incorporated
``rcu_barrier()`` into RCU. The need for ``rcu_barrier()`` for module
rcu_barrier() into RCU. The need for rcu_barrier() for module
  unloading became apparent later.
  
  .. important::
  
-    The ``rcu_barrier()`` function is not, repeat,
+    The rcu_barrier() function is not, repeat,
     *not*, obligated to wait for a grace period. It is instead only required
     to wait for RCU callbacks that have already been posted. Therefore, if
     there are no RCU callbacks posted anywhere in the system,
-    ``rcu_barrier()`` is within its rights to return immediately. Even if
-    there are callbacks posted, ``rcu_barrier()`` does not necessarily need
+    rcu_barrier() is within its rights to return immediately. Even if
+    there are callbacks posted, rcu_barrier() does not necessarily need
     to wait for a grace period.
  
  +-----------------------------------------------------------------------+
  | **Quick Quiz**:                                                       |
  +-----------------------------------------------------------------------+
  | Wait a minute! Each RCU callbacks must wait for a grace period to     |
- | complete, and ``rcu_barrier()`` must wait for each pre-existing       |
- | callback to be invoked. Doesn't ``rcu_barrier()`` therefore need to   |
+ | complete, and rcu_barrier() must wait for each pre-existing           |
+ | callback to be invoked. Doesn't rcu_barrier() therefore need to       |
  | wait for a full grace period if there is even one callback posted     |
  | anywhere in the system?                                               |
  +-----------------------------------------------------------------------+
  | Absolutely not!!!                                                     |
  | Yes, each RCU callbacks must wait for a grace period to complete, but |
  | it might well be partly (or even completely) finished waiting by the  |
- | time ``rcu_barrier()`` is invoked. In that case, ``rcu_barrier()``    |
+ | time rcu_barrier() is invoked. In that case, rcu_barrier()            |
  | need only wait for the remaining portion of the grace period to       |
  | elapse. So even if there are quite a few callbacks posted,            |
- | ``rcu_barrier()`` might well return quite quickly.                    |
+ | rcu_barrier() might well return quite quickly.                        |
  |                                                                       |
  | So if you need to wait for a grace period as well as for all          |
  | pre-existing callbacks, you will need to invoke both                  |
- | ``synchronize_rcu()`` and ``rcu_barrier()``. If latency is a concern, |
+ | synchronize_rcu() and rcu_barrier(). If latency is a concern,         |
  | you can always use workqueues to invoke them concurrently.            |
  +-----------------------------------------------------------------------+
  
@@@ -1920,7 -1918,7 +1918,7 @@@ Hotplug CP
  
  The Linux kernel supports CPU hotplug, which means that CPUs can come
  and go. It is of course illegal to use any RCU API member from an
 -offline CPU, with the exception of `SRCU <#Sleepable%20RCU>`__ read-side
 +offline CPU, with the exception of `SRCU <Sleepable RCU_>`__ read-side
  critical sections. This requirement was present from day one in
  DYNIX/ptx, but on the other hand, the Linux kernel's CPU-hotplug
  implementation is “interesting.”
@@@ -1929,18 -1927,18 +1927,18 @@@ The Linux-kernel CPU-hotplug implementa
  to allow the various kernel subsystems (including RCU) to respond
  appropriately to a given CPU-hotplug operation. Most RCU operations may
  be invoked from CPU-hotplug notifiers, including even synchronous
- grace-period operations such as (``synchronize_rcu()`` and
``synchronize_rcu_expedited()``).  However, these synchronous operations
+ grace-period operations such as (synchronize_rcu() and
synchronize_rcu_expedited()).  However, these synchronous operations
  do block and therefore cannot be invoked from notifiers that execute via
``stop_machine()``, specifically those between the ``CPUHP_AP_OFFLINE``
stop_machine(), specifically those between the ``CPUHP_AP_OFFLINE``
  and ``CPUHP_AP_ONLINE`` states.
  
- In addition, all-callback-wait operations such as ``rcu_barrier()`` may
+ In addition, all-callback-wait operations such as rcu_barrier() may
  not be invoked from any CPU-hotplug notifier.  This restriction is due
  to the fact that there are phases of CPU-hotplug operations where the
  outgoing CPU's callbacks will not be invoked until after the CPU-hotplug
  operation ends, which could also result in deadlock. Furthermore,
``rcu_barrier()`` blocks CPU-hotplug operations during its execution,
rcu_barrier() blocks CPU-hotplug operations during its execution,
  which results in another type of deadlock when invoked from a CPU-hotplug
  notifier.
  
@@@ -1955,12 -1953,12 +1953,12 @@@ if offline CPUs block an RCU grace peri
  
  An offline CPU's quiescent state will be reported either:
  
- 1.  As the CPU goes offline using RCU's hotplug notifier (``rcu_report_dead()``).
- 2.  When grace period initialization (``rcu_gp_init()``) detects a
+ 1.  As the CPU goes offline using RCU's hotplug notifier (rcu_report_dead()).
+ 2.  When grace period initialization (rcu_gp_init()) detects a
      race either with CPU offlining or with a task unblocking on a leaf
      ``rcu_node`` structure whose CPUs are all offline.
  
- The CPU-online path (``rcu_cpu_starting()``) should never need to report
+ The CPU-online path (rcu_cpu_starting()) should never need to report
  a quiescent state for an offline CPU.  However, as a debugging measure,
  it does emit a warning if a quiescent state was not already reported
  for that CPU.
@@@ -1984,11 -1982,11 +1982,11 @@@ room for further improvement
  
  There is no longer any prohibition against holding any of
  scheduler's runqueue or priority-inheritance spinlocks across an
``rcu_read_unlock()``, even if interrupts and preemption were enabled
rcu_read_unlock(), even if interrupts and preemption were enabled
  somewhere within the corresponding RCU read-side critical section.
- Therefore, it is now perfectly legal to execute ``rcu_read_lock()``
+ Therefore, it is now perfectly legal to execute rcu_read_lock()
  with preemption enabled, acquire one of the scheduler locks, and hold
- that lock across the matching ``rcu_read_unlock()``.
+ that lock across the matching rcu_read_unlock().
  
  Similarly, the RCU flavor consolidation has removed the need for negative
  nesting.  The fact that interrupt-disabled regions of code act as RCU
@@@ -1999,7 -1997,7 +1997,7 @@@ Tracing and RC
  ~~~~~~~~~~~~~~~
  
  It is possible to use tracing on RCU code, but tracing itself uses RCU.
- For this reason, ``rcu_dereference_raw_check()`` is provided for use
+ For this reason, rcu_dereference_raw_check() is provided for use
  by tracing, which avoids the destructive recursion that could otherwise
  ensue. This API is also used by virtualization in some architectures,
  where RCU readers execute in environments in which tracing cannot be
@@@ -2010,12 -2008,12 +2008,12 @@@ Accesses to User Memory and RC
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  
  The kernel needs to access user-space memory, for example, to access data
- referenced by system-call parameters.  The ``get_user()`` macro does this job.
+ referenced by system-call parameters.  The get_user() macro does this job.
  
  However, user-space memory might well be paged out, which means that
``get_user()`` might well page-fault and thus block while waiting for the
get_user() might well page-fault and thus block while waiting for the
  resulting I/O to complete.  It would be a very bad thing for the compiler to
- reorder a ``get_user()`` invocation into an RCU read-side critical section.
+ reorder a get_user() invocation into an RCU read-side critical section.
  
  For example, suppose that the source code looked like this:
  
@@@ -2040,23 -2038,23 +2038,23 @@@ the following
         5 rcu_read_unlock();
         6 do_something_with(v, user_v);
  
- If the compiler did make this transformation in a ``CONFIG_PREEMPT=n`` kernel
- build, and if ``get_user()`` did page fault, the result would be a quiescent
+ If the compiler did make this transformation in a ``CONFIG_PREEMPTION=n`` kernel
+ build, and if get_user() did page fault, the result would be a quiescent
  state in the middle of an RCU read-side critical section.  This misplaced
  quiescent state could result in line 4 being a use-after-free access,
  which could be bad for your kernel's actuarial statistics.  Similar examples
- can be constructed with the call to ``get_user()`` preceding the
``rcu_read_lock()``.
+ can be constructed with the call to get_user() preceding the
rcu_read_lock().
  
- Unfortunately, ``get_user()`` doesn't have any particular ordering properties,
+ Unfortunately, get_user() doesn't have any particular ordering properties,
  and in some architectures the underlying ``asm`` isn't even marked
  ``volatile``.  And even if it was marked ``volatile``, the above access to
  ``p->value`` is not volatile, so the compiler would not have any reason to keep
  those two accesses in order.
  
- Therefore, the Linux-kernel definitions of ``rcu_read_lock()`` and
``rcu_read_unlock()`` must act as compiler barriers, at least for outermost
- instances of ``rcu_read_lock()`` and ``rcu_read_unlock()`` within a nested set
+ Therefore, the Linux-kernel definitions of rcu_read_lock() and
rcu_read_unlock() must act as compiler barriers, at least for outermost
+ instances of rcu_read_lock() and rcu_read_unlock() within a nested set
  of RCU read-side critical sections.
  
  Energy Efficiency
@@@ -2071,26 -2069,26 +2069,26 @@@ call
  
  Because RCU avoids interrupting idle CPUs, it is illegal to execute an
  RCU read-side critical section on an idle CPU. (Kernels built with
- ``CONFIG_PROVE_RCU=y`` will splat if you try it.) The ``RCU_NONIDLE()``
+ ``CONFIG_PROVE_RCU=y`` will splat if you try it.) The RCU_NONIDLE()
  macro and ``_rcuidle`` event tracing is provided to work around this
- restriction. In addition, ``rcu_is_watching()`` may be used to test
+ restriction. In addition, rcu_is_watching() may be used to test
  whether or not it is currently legal to run RCU read-side critical
  sections on this CPU. I learned of the need for diagnostics on the one
- hand and ``RCU_NONIDLE()`` on the other while inspecting idle-loop code.
+ hand and RCU_NONIDLE() on the other while inspecting idle-loop code.
  Steven Rostedt supplied ``_rcuidle`` event tracing, which is used quite
  heavily in the idle loop. However, there are some restrictions on the
- code placed within ``RCU_NONIDLE()``:
+ code placed within RCU_NONIDLE():
  
  #. Blocking is prohibited. In practice, this is not a serious
     restriction given that idle tasks are prohibited from blocking to
     begin with.
- #. Although nesting ``RCU_NONIDLE()`` is permitted, they cannot nest
+ #. Although nesting RCU_NONIDLE() is permitted, they cannot nest
     indefinitely deeply. However, given that they can be nested on the
     order of a million deep, even on 32-bit systems, this should not be a
     serious restriction. This nesting limit would probably be reached
     long after the compiler OOMed or the stack overflowed.
- #. Any code path that enters ``RCU_NONIDLE()`` must sequence out of that
-    same ``RCU_NONIDLE()``. For example, the following is grossly
+ #. Any code path that enters RCU_NONIDLE() must sequence out of that
+    same RCU_NONIDLE(). For example, the following is grossly
     illegal:
  
        ::
  
  
     It is just as illegal to transfer control into the middle of
-    ``RCU_NONIDLE()``'s argument. Yes, in theory, you could transfer in
+    RCU_NONIDLE()'s argument. Yes, in theory, you could transfer in
     as long as you also transferred out, but in practice you could also
     expect to get sharply worded review comments.
  
@@@ -2177,7 -2175,7 +2175,7 @@@ handles these states differently
  However, RCU must be reliably informed as to whether any given CPU is
  currently in the idle loop, and, for ``NO_HZ_FULL``, also whether that
  CPU is executing in usermode, as discussed
 -`earlier <#Energy%20Efficiency>`__. It also requires that the
 +`earlier <Energy Efficiency_>`__. It also requires that the
  scheduling-clock interrupt be enabled when RCU needs it to be:
  
  #. If a CPU is either idle or executing in usermode, and RCU believes it
     sections, and RCU believes this CPU to be idle, no problem. This
     sort of thing is used by some architectures for light-weight
     exception handlers, which can then avoid the overhead of
-    ``rcu_irq_enter()`` and ``rcu_irq_exit()`` at exception entry and
+    rcu_irq_enter() and rcu_irq_exit() at exception entry and
     exit, respectively. Some go further and avoid the entireties of
-    ``irq_enter()`` and ``irq_exit()``.
+    irq_enter() and irq_exit().
     Just make very sure you are running some of your tests with
     ``CONFIG_PROVE_RCU=y``, just in case one of your code paths was in
     fact joking about not doing RCU read-side critical sections.
  | **Quick Quiz**:                                                       |
  +-----------------------------------------------------------------------+
  | But what if my driver has a hardware interrupt handler that can run   |
- | for many seconds? I cannot invoke ``schedule()`` from an hardware     |
+ | for many seconds? I cannot invoke schedule() from an hardware         |
  | interrupt handler, after all!                                         |
  +-----------------------------------------------------------------------+
  | **Answer**:                                                           |
@@@ -2243,8 -2241,8 +2241,8 @@@ Memory Efficienc
  
  Although small-memory non-realtime systems can simply use Tiny RCU, code
  size is only one aspect of memory efficiency. Another aspect is the size
- of the ``rcu_head`` structure used by ``call_rcu()`` and
``kfree_rcu()``. Although this structure contains nothing more than a
+ of the ``rcu_head`` structure used by call_rcu() and
kfree_rcu(). Although this structure contains nothing more than a
  pair of pointers, it does appear in many RCU-protected data structures,
  including some that are size critical. The ``page`` structure is a case
  in point, as evidenced by the many occurrences of the ``union`` keyword
@@@ -2254,7 -2252,7 +2252,7 @@@ This need for memory efficiency is one 
  singly linked lists to track the ``rcu_head`` structures that are
  waiting for a grace period to elapse. It is also the reason why
  ``rcu_head`` structures do not contain debug information, such as fields
- tracking the file and line of the ``call_rcu()`` or ``kfree_rcu()`` that
+ tracking the file and line of the call_rcu() or kfree_rcu() that
  posted them. Although this information might appear in debug-only kernel
  builds at some point, in the meantime, the ``->func`` field will often
  provide the needed debug information.
@@@ -2264,18 -2262,18 +2262,18 @@@ more extreme measures. Returning to th
  ``rcu_head`` field shares storage with a great many other structures
  that are used at various points in the corresponding page's lifetime. In
  order to correctly resolve certain `race
- conditions <https://lkml.kernel.org/g/1439976106-137226-1-git-send-email-kirill.shutemov@linux.intel.com>`__,
+ conditions <https://lore.kernel.org/r/1439976106-137226-1-git-send-email-kirill.shutemov@linux.intel.com>`__,
  the Linux kernel's memory-management subsystem needs a particular bit to
  remain zero during all phases of grace-period processing, and that bit
  happens to map to the bottom bit of the ``rcu_head`` structure's
- ``->next`` field. RCU makes this guarantee as long as ``call_rcu()`` is
- used to post the callback, as opposed to ``kfree_rcu()`` or some future
- “lazy” variant of ``call_rcu()`` that might one day be created for
+ ``->next`` field. RCU makes this guarantee as long as call_rcu() is
+ used to post the callback, as opposed to kfree_rcu() or some future
+ “lazy” variant of call_rcu() that might one day be created for
  energy-efficiency purposes.
  
  That said, there are limits. RCU requires that the ``rcu_head``
  structure be aligned to a two-byte boundary, and passing a misaligned
- ``rcu_head`` structure to one of the ``call_rcu()`` family of functions
+ ``rcu_head`` structure to one of the call_rcu() family of functions
  will result in a splat. It is therefore necessary to exercise caution
  when packing structures containing fields of type ``rcu_head``. Why not
  a four-byte or even eight-byte alignment requirement? Because the m68k
@@@ -2294,12 -2292,12 +2292,12 @@@ Performance, Scalability, Response Time
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  
  Expanding on the `earlier
 -discussion <#Performance%20and%20Scalability>`__, RCU is used heavily by
 +discussion <Performance and Scalability_>`__, RCU is used heavily by
  hot code paths in performance-critical portions of the Linux kernel's
  networking, security, virtualization, and scheduling code paths. RCU
  must therefore use efficient implementations, especially in its
  read-side primitives. To that end, it would be good if preemptible RCU's
- implementation of ``rcu_read_lock()`` could be inlined, however, doing
+ implementation of rcu_read_lock() could be inlined, however, doing
  this requires resolving ``#include`` issues with the ``task_struct``
  structure.
  
@@@ -2312,23 -2310,23 +2310,23 @@@ on the ``rcu_node`` structure. RCU is r
  continuously invoking any combination of RCU's runtime primitives with
  minimal per-operation overhead. In fact, in many cases, increasing load
  must *decrease* the per-operation overhead, witness the batching
- optimizations for ``synchronize_rcu()``, ``call_rcu()``,
``synchronize_rcu_expedited()``, and ``rcu_barrier()``. As a general
+ optimizations for synchronize_rcu(), call_rcu(),
synchronize_rcu_expedited(), and rcu_barrier(). As a general
  rule, RCU must cheerfully accept whatever the rest of the Linux kernel
  decides to throw at it.
  
  The Linux kernel is used for real-time workloads, especially in
  conjunction with the `-rt
- patchset <https://rt.wiki.kernel.org/index.php/Main_Page>`__. The
+ patchset <https://wiki.linuxfoundation.org/realtime/>`__. The
  real-time-latency response requirements are such that the traditional
  approach of disabling preemption across RCU read-side critical sections
- is inappropriate. Kernels built with ``CONFIG_PREEMPT=y`` therefore use
+ is inappropriate. Kernels built with ``CONFIG_PREEMPTION=y`` therefore use
  an RCU implementation that allows RCU read-side critical sections to be
  preempted. This requirement made its presence known after users made it
  clear that an earlier `real-time
  patch <https://lwn.net/Articles/107930/>`__ did not meet their needs, in
  conjunction with some `RCU
- issues <https://lkml.kernel.org/g/[email protected]>`__
+ issues <https://lore.kernel.org/r/[email protected]>`__
  encountered by a very early version of the -rt patchset.
  
  In addition, RCU must make do with a sub-100-microsecond real-time
@@@ -2346,7 -2344,7 +2344,7 @@@ number of race conditions
  RCU must avoid degrading real-time response for CPU-bound threads,
  whether executing in usermode (which is one use case for
  ``CONFIG_NO_HZ_FULL=y``) or in the kernel. That said, CPU-bound loops in
- the kernel must execute ``cond_resched()`` at least once per few tens of
+ the kernel must execute cond_resched() at least once per few tens of
  milliseconds in order to avoid receiving an IPI from RCU.
  
  Finally, RCU's status as a synchronization primitive means that any RCU
@@@ -2412,7 -2410,7 +2410,7 @@@ grace periods from ever ending. The res
  condition and a system hang.
  
  The solution was the creation of RCU-bh, which does
``local_bh_disable()`` across its read-side critical sections, and which
local_bh_disable() across its read-side critical sections, and which
  uses the transition from one type of softirq processing to another as a
  quiescent state in addition to context switch, idle, user mode, and
  offline. This means that RCU-bh grace periods can complete even when
@@@ -2420,31 -2418,31 +2418,31 @@@ some of the CPUs execute in softirq ind
  algorithms based on RCU-bh to withstand network-based denial-of-service
  attacks.
  
- Because ``rcu_read_lock_bh()`` and ``rcu_read_unlock_bh()`` disable and
+ Because rcu_read_lock_bh() and rcu_read_unlock_bh() disable and
  re-enable softirq handlers, any attempt to start a softirq handlers
  during the RCU-bh read-side critical section will be deferred. In this
- case, ``rcu_read_unlock_bh()`` will invoke softirq processing, which can
+ case, rcu_read_unlock_bh() will invoke softirq processing, which can
  take considerable time. One can of course argue that this softirq
  overhead should be associated with the code following the RCU-bh
- read-side critical section rather than ``rcu_read_unlock_bh()``, but the
+ read-side critical section rather than rcu_read_unlock_bh(), but the
  fact is that most profiling tools cannot be expected to make this sort
  of fine distinction. For example, suppose that a three-millisecond-long
  RCU-bh read-side critical section executes during a time of heavy
  networking load. There will very likely be an attempt to invoke at least
  one softirq handler during that three milliseconds, but any such
  invocation will be delayed until the time of the
``rcu_read_unlock_bh()``. This can of course make it appear at first
- glance as if ``rcu_read_unlock_bh()`` was executing very slowly.
rcu_read_unlock_bh(). This can of course make it appear at first
+ glance as if rcu_read_unlock_bh() was executing very slowly.
  
  The `RCU-bh
  API <https://lwn.net/Articles/609973/#RCU%20Per-Flavor%20API%20Table>`__
- includes ``rcu_read_lock_bh()``, ``rcu_read_unlock_bh()``,
- ``rcu_dereference_bh()``, ``rcu_dereference_bh_check()``,
``synchronize_rcu_bh()``, ``synchronize_rcu_bh_expedited()``,
- ``call_rcu_bh()``, ``rcu_barrier_bh()``, and
- ``rcu_read_lock_bh_held()``. However, the update-side APIs are now
- simple wrappers for other RCU flavors, namely RCU-sched in
CONFIG_PREEMPT=n kernels and RCU-preempt otherwise.
+ includes rcu_read_lock_bh(), rcu_read_unlock_bh(), rcu_dereference_bh(),
+ rcu_dereference_bh_check(), and rcu_read_lock_bh_held(). However, the
old RCU-bh update-side APIs are now gone, replaced by synchronize_rcu(),
+ synchronize_rcu_expedited(), call_rcu(), and rcu_barrier().  In addition,
+ anything that disables bottom halves also marks an RCU-bh read-side
+ critical section, including local_bh_disable() and local_bh_enable(),
local_irq_save() and local_irq_restore(), and so on.
  
  Sched Flavor (Historical)
  ~~~~~~~~~~~~~~~~~~~~~~~~~
@@@ -2462,32 -2460,32 +2460,32 @@@ not have this property, given that any 
  RCU read-side critical section can be a quiescent state. Therefore,
  *RCU-sched* was created, which follows “classic” RCU in that an
  RCU-sched grace period waits for pre-existing interrupt and NMI
- handlers. In kernels built with ``CONFIG_PREEMPT=n``, the RCU and
+ handlers. In kernels built with ``CONFIG_PREEMPTION=n``, the RCU and
  RCU-sched APIs have identical implementations, while kernels built with
- ``CONFIG_PREEMPT=y`` provide a separate implementation for each.
+ ``CONFIG_PREEMPTION=y`` provide a separate implementation for each.
  
- Note well that in ``CONFIG_PREEMPT=y`` kernels,
``rcu_read_lock_sched()`` and ``rcu_read_unlock_sched()`` disable and
+ Note well that in ``CONFIG_PREEMPTION=y`` kernels,
rcu_read_lock_sched() and rcu_read_unlock_sched() disable and
  re-enable preemption, respectively. This means that if there was a
  preemption attempt during the RCU-sched read-side critical section,
``rcu_read_unlock_sched()`` will enter the scheduler, with all the
- latency and overhead entailed. Just as with ``rcu_read_unlock_bh()``,
- this can make it look as if ``rcu_read_unlock_sched()`` was executing
rcu_read_unlock_sched() will enter the scheduler, with all the
+ latency and overhead entailed. Just as with rcu_read_unlock_bh(),
+ this can make it look as if rcu_read_unlock_sched() was executing
  very slowly. However, the highest-priority task won't be preempted, so
- that task will enjoy low-overhead ``rcu_read_unlock_sched()``
+ that task will enjoy low-overhead rcu_read_unlock_sched()
  invocations.
  
  The `RCU-sched
  API <https://lwn.net/Articles/609973/#RCU%20Per-Flavor%20API%20Table>`__
- includes ``rcu_read_lock_sched()``, ``rcu_read_unlock_sched()``,
``rcu_read_lock_sched_notrace()``, ``rcu_read_unlock_sched_notrace()``,
- ``rcu_dereference_sched()``, ``rcu_dereference_sched_check()``,
- ``synchronize_sched()``, ``synchronize_rcu_sched_expedited()``,
- ``call_rcu_sched()``, ``rcu_barrier_sched()``, and
``rcu_read_lock_sched_held()``. However, anything that disables
- preemption also marks an RCU-sched read-side critical section, including
- ``preempt_disable()`` and ``preempt_enable()``, ``local_irq_save()`` and
``local_irq_restore()``, and so on.
+ includes rcu_read_lock_sched(), rcu_read_unlock_sched(),
rcu_read_lock_sched_notrace(), rcu_read_unlock_sched_notrace(),
+ rcu_dereference_sched(), rcu_dereference_sched_check(), and
+ rcu_read_lock_sched_held().  However, the old RCU-sched update-side APIs
+ are now gone, replaced by synchronize_rcu(), synchronize_rcu_expedited(),
call_rcu(), and rcu_barrier().  In addition, anything that disables
+ preemption also marks an RCU-sched read-side critical section,
+ including preempt_disable() and preempt_enable(), local_irq_save()
and local_irq_restore(), and so on.
  
  Sleepable RCU
  ~~~~~~~~~~~~~
@@@ -2509,7 -2507,7 +2507,7 @@@ this structure must be passed in to eac
  structure. The key benefit of these domains is that a slow SRCU reader
  in one domain does not delay an SRCU grace period in some other domain.
  That said, one consequence of these domains is that read-side code must
- pass a “cookie” from ``srcu_read_lock()`` to ``srcu_read_unlock()``, for
+ pass a “cookie” from srcu_read_lock() to srcu_read_unlock(), for
  example, as follows:
  
     ::
@@@ -2539,24 -2537,24 +2537,24 @@@ period to elapse. For example, this res
         6 srcu_read_unlock(&ss, idx);
  
  However, if line 5 acquired a mutex that was held across a
``synchronize_srcu()`` for domain ``ss``, deadlock would still be
synchronize_srcu() for domain ``ss``, deadlock would still be
  possible. Furthermore, if line 5 acquired a mutex that was held across a
``synchronize_srcu()`` for some other domain ``ss1``, and if an
synchronize_srcu() for some other domain ``ss1``, and if an
  ``ss1``-domain SRCU read-side critical section acquired another mutex
- that was held across as ``ss``-domain ``synchronize_srcu()``, deadlock
+ that was held across as ``ss``-domain synchronize_srcu(), deadlock
  would again be possible. Such a deadlock cycle could extend across an
  arbitrarily large number of different SRCU domains. Again, with great
  power comes great responsibility.
  
  Unlike the other RCU flavors, SRCU read-side critical sections can run
  on idle and even offline CPUs. This ability requires that
``srcu_read_lock()`` and ``srcu_read_unlock()`` contain memory barriers,
srcu_read_lock() and srcu_read_unlock() contain memory barriers,
  which means that SRCU readers will run a bit slower than would RCU
- readers. It also motivates the ``smp_mb__after_srcu_read_unlock()`` API,
- which, in combination with ``srcu_read_unlock()``, guarantees a full
+ readers. It also motivates the smp_mb__after_srcu_read_unlock() API,
+ which, in combination with srcu_read_unlock(), guarantees a full
  memory barrier.
  
- Also unlike other RCU flavors, ``synchronize_srcu()`` may **not** be
+ Also unlike other RCU flavors, synchronize_srcu() may **not** be
  invoked from CPU-hotplug notifiers, due to the fact that SRCU grace
  periods make use of timers and the possibility of timers being
  temporarily “stranded” on the outgoing CPU. This stranding of timers
@@@ -2565,7 -2563,7 +2563,7 @@@ the CPU-hotplug process. The problem i
  an SRCU grace period, that grace period is waiting on a timer, and that
  timer is stranded on the outgoing CPU, then the notifier will never be
  awakened, in other words, deadlock has occurred. This same situation of
- course also prohibits ``srcu_barrier()`` from being invoked from
+ course also prohibits srcu_barrier() from being invoked from
  CPU-hotplug notifiers.
  
  SRCU also differs from other RCU flavors in that SRCU's expedited and
@@@ -2576,12 -2574,12 +2574,12 @@@ have not yet completed. (But please not
  current implementation, not necessarily of future implementations.) In
  addition, if SRCU has been idle for longer than the interval specified
  by the ``srcutree.exp_holdoff`` kernel boot parameter (25 microseconds
- by default), and if a ``synchronize_srcu()`` invocation ends this idle
+ by default), and if a synchronize_srcu() invocation ends this idle
  period, that invocation will be automatically expedited.
  
  As of v4.12, SRCU's callbacks are maintained per-CPU, eliminating a
  locking bottleneck present in prior kernel versions. Although this will
- allow users to put much heavier stress on ``call_srcu()``, it is
+ allow users to put much heavier stress on call_srcu(), it is
  important to note that SRCU does not yet take any special steps to deal
  with callback flooding. So if you are posting (say) 10,000 SRCU
  callbacks per second per CPU, you are probably totally OK, but if you
@@@ -2592,14 -2590,32 +2590,32 @@@ of your CPUs and the size of your memor
  
  The `SRCU
  API <https://lwn.net/Articles/609973/#RCU%20Per-Flavor%20API%20Table>`__
- includes ``srcu_read_lock()``, ``srcu_read_unlock()``,
``srcu_dereference()``, ``srcu_dereference_check()``,
``synchronize_srcu()``, ``synchronize_srcu_expedited()``,
``call_srcu()``, ``srcu_barrier()``, and ``srcu_read_lock_held()``. It
- also includes ``DEFINE_SRCU()``, ``DEFINE_STATIC_SRCU()``, and
``init_srcu_struct()`` APIs for defining and initializing
+ includes srcu_read_lock(), srcu_read_unlock(),
srcu_dereference(), srcu_dereference_check(),
synchronize_srcu(), synchronize_srcu_expedited(),
call_srcu(), srcu_barrier(), and srcu_read_lock_held(). It
+ also includes DEFINE_SRCU(), DEFINE_STATIC_SRCU(), and
init_srcu_struct() APIs for defining and initializing
  ``srcu_struct`` structures.
  
+ More recently, the SRCU API has added polling interfaces:
+ #. start_poll_synchronize_srcu() returns a cookie identifying
+    the completion of a future SRCU grace period and ensures
+    that this grace period will be started.
+ #. poll_state_synchronize_srcu() returns ``true`` iff the
+    specified cookie corresponds to an already-completed
+    SRCU grace period.
+ #. get_state_synchronize_srcu() returns a cookie just like
+    start_poll_synchronize_srcu() does, but differs in that
+    it does nothing to ensure that any future SRCU grace period
+    will be started.
+ These functions are used to avoid unnecessary SRCU grace periods in
+ certain types of buffer-cache algorithms having multi-stage age-out
+ mechanisms.  The idea is that by the time the block has aged completely
+ from the cache, an SRCU grace period will be very likely to have elapsed.
  Tasks RCU
  ~~~~~~~~~
  
@@@ -2608,11 -2624,11 +2624,11 @@@ required to install different types of 
  able to free old trampolines, which sounds like a job for some form of
  RCU. However, because it is necessary to be able to install a trace
  anywhere in the code, it is not possible to use read-side markers such
- as ``rcu_read_lock()`` and ``rcu_read_unlock()``. In addition, it does
+ as rcu_read_lock() and rcu_read_unlock(). In addition, it does
  not work to have these markers in the trampoline itself, because there
- would need to be instructions following ``rcu_read_unlock()``. Although
``synchronize_rcu()`` would guarantee that execution reached the
``rcu_read_unlock()``, it would not be able to guarantee that execution
+ would need to be instructions following rcu_read_unlock(). Although
synchronize_rcu() would guarantee that execution reached the
rcu_read_unlock(), it would not be able to guarantee that execution
  had completely left the trampoline. Worse yet, in some situations
  the trampoline's protection must extend a few instructions *prior* to
  execution reaching the trampoline.  For example, these few instructions
@@@ -2623,16 -2639,16 +2639,16 @@@ actually reached the trampoline itself
  The solution, in the form of `Tasks
  RCU <https://lwn.net/Articles/607117/>`__, is to have implicit read-side
  critical sections that are delimited by voluntary context switches, that
- is, calls to ``schedule()``, ``cond_resched()``, and
``synchronize_rcu_tasks()``. In addition, transitions to and from
+ is, calls to schedule(), cond_resched(), and
synchronize_rcu_tasks(). In addition, transitions to and from
  userspace execution also delimit tasks-RCU read-side critical sections.
  
  The tasks-RCU API is quite compact, consisting only of
``call_rcu_tasks()``, ``synchronize_rcu_tasks()``, and
``rcu_barrier_tasks()``. In ``CONFIG_PREEMPT=n`` kernels, trampolines
- cannot be preempted, so these APIs map to ``call_rcu()``,
``synchronize_rcu()``, and ``rcu_barrier()``, respectively. In
- ``CONFIG_PREEMPT=y`` kernels, trampolines can be preempted, and these
call_rcu_tasks(), synchronize_rcu_tasks(), and
rcu_barrier_tasks(). In ``CONFIG_PREEMPTION=n`` kernels, trampolines
+ cannot be preempted, so these APIs map to call_rcu(),
synchronize_rcu(), and rcu_barrier(), respectively. In
+ ``CONFIG_PREEMPTION=y`` kernels, trampolines can be preempted, and these
  three APIs are therefore implemented by separate functions that check
  for voluntary context switches.
  
@@@ -2646,8 -2662,8 +2662,8 @@@ grace-period state machine so as to avo
  latency.
  
  RCU disables CPU hotplug in a few places, perhaps most notably in the
``rcu_barrier()`` operations. If there is a strong reason to use
``rcu_barrier()`` in CPU-hotplug notifiers, it will be necessary to
rcu_barrier() operations. If there is a strong reason to use
rcu_barrier() in CPU-hotplug notifiers, it will be necessary to
  avoid disabling CPU hotplug. This would introduce some complexity, so
  there had better be a *very* good reason.
  
@@@ -2664,7 -2680,7 +2680,7 @@@ However, this combining tree does not s
  nodes nor does it align the CPU groups with hardware features such as
  sockets or cores. Such spreading and alignment is currently believed to
  be unnecessary because the hotpath read-side primitives do not access
- the combining tree, nor does ``call_rcu()`` in the common case. If you
+ the combining tree, nor does call_rcu() in the common case. If you
  believe that your architecture needs such spreading and alignment, then
  your architecture should also benefit from the
  ``rcutree.rcu_fanout_leaf`` boot parameter, which can be set to the
@@@ -2685,7 -2701,7 +2701,7 @@@ likely that adjustments will be require
  extreme loads. It might also be necessary to be able to relate CPU
  utilization by RCU's kthreads and softirq handlers to the code that
  instigated this CPU utilization. For example, RCU callback overhead
- might be charged back to the originating ``call_rcu()`` instance, though
+ might be charged back to the originating call_rcu() instance, though
  probably not in production kernels.
  
  Additional work may be required to provide reasonable forward-progress
index a10b545c2070a54455c3e7181cc43135dc68f611,b1d6cd58a04c7979ccb14aa0b9fffa67b85ce6c3..0936f5e9288b2c86be6289b813c59dc024233f21
  
        ftrace_filter=[function-list]
                        [FTRACE] Limit the functions traced by the function
 -                      tracer at boot up. function-list is a comma separated
 +                      tracer at boot up. function-list is a comma-separated
                        list of functions. This list can be changed at run
                        time by the set_ftrace_filter file in the debugfs
                        tracing directory.
        ftrace_graph_filter=[function-list]
                        [FTRACE] Limit the top level callers functions traced
                        by the function graph tracer at boot up.
 -                      function-list is a comma separated list of functions
 +                      function-list is a comma-separated list of functions
                        that can be changed at run time by the
                        set_graph_function file in the debugfs tracing directory.
  
        ftrace_graph_notrace=[function-list]
                        [FTRACE] Do not trace from the functions specified in
 -                      function-list.  This list is a comma separated list of
 +                      function-list.  This list is a comma-separated list of
                        functions that can be changed at run time by the
                        set_graph_notrace file in the debugfs tracing directory.
  
                        when set.
                        Format: <int>
  
 -      libata.force=   [LIBATA] Force configurations.  The format is comma
 +      libata.force=   [LIBATA] Force configurations.  The format is comma-
                        separated list of "[ID:]VAL" where ID is
                        PORT[.DEVICE].  PORT and DEVICE are decimal numbers
                        matching port, link or device.  Basically, it matches
                        value, meaning that RCU_SOFTIRQ is used by default.
                        Specify rcutree.use_softirq=0 to use rcuc kthreads.
  
+                       But note that CONFIG_PREEMPT_RT=y kernels disable
+                       this kernel boot parameter, forcibly setting it
+                       to zero.
        rcutree.rcu_fanout_exact= [KNL]
                        Disable autobalancing of the rcu_node combining
                        tree.  This is used by rcutorture, and might
                        Set wakeup interval for idle CPUs that have
                        RCU callbacks (RCU_FAST_NO_HZ=y).
  
-       rcutree.rcu_idle_lazy_gp_delay= [KNL]
-                       Set wakeup interval for idle CPUs that have
-                       only "lazy" RCU callbacks (RCU_FAST_NO_HZ=y).
-                       Lazy RCU callbacks are those which RCU can
-                       prove do nothing more than free memory.
        rcutree.rcu_kick_kthreads= [KNL]
                        Cause the grace-period kthread to get an extra
                        wake_up() if it sleeps three times longer than
                        stress RCU, they don't participate in the actual
                        test, hence the "fake".
  
+       rcutorture.nocbs_nthreads= [KNL]
+                       Set number of RCU callback-offload togglers.
+                       Zero (the default) disables toggling.
+       rcutorture.nocbs_toggle= [KNL]
+                       Set the delay in milliseconds between successive
+                       callback-offload toggling attempts.
        rcutorture.nreaders= [KNL]
                        Set number of RCU readers.  The value -1 selects
                        N-1, where N is the number of CPUs.  A value
                        only normal grace-period primitives.  No effect
                        on CONFIG_TINY_RCU kernels.
  
+                       But note that CONFIG_PREEMPT_RT=y kernels enables
+                       this kernel boot parameter, forcibly setting
+                       it to the value one, that is, converting any
+                       post-boot attempt at an expedited RCU grace
+                       period to instead use normal non-expedited
+                       grace-period processing.
        rcupdate.rcu_task_ipi_delay= [KNL]
                        Set time in jiffies during which RCU tasks will
                        avoid sending IPIs, starting with the beginning
        refscale.verbose= [KNL]
                        Enable additional printk() statements.
  
+       refscale.verbose_batched= [KNL]
+                       Batch the additional printk() statements.  If zero
+                       (the default) or negative, print everything.  Otherwise,
+                       print every Nth verbose statement, where N is the value
+                       specified.
        relax_domain_level=
                        [KNL, SMP] Set scheduler's default relax_domain_level.
                        See Documentation/admin-guide/cgroup-v1/cpusets.rst.
  
        stacktrace_filter=[function-list]
                        [FTRACE] Limit the functions that the stack tracer
 -                      will trace at boot up. function-list is a comma separated
 +                      will trace at boot up. function-list is a comma-separated
                        list of functions. This list can be changed at run
                        time by the stack_trace_filter file in the debugfs
                        tracing directory. Note, this enables stack tracing
                        are running concurrently, especially on systems
                        with rotating-rust storage.
  
+       torture.verbose_sleep_frequency= [KNL]
+                       Specifies how many verbose printk()s should be
+                       emitted between each sleep.  The default of zero
+                       disables verbose-printk() sleeping.
+       torture.verbose_sleep_duration= [KNL]
+                       Duration of each verbose-printk() sleep in jiffies.
        tp720=          [HW,PS2]
  
        tpm_suspend_pcr=[HW,TPM]
        trace_event=[event-list]
                        [FTRACE] Set and start specified trace events in order
                        to facilitate early boot debugging. The event-list is a
 -                      comma separated list of trace events to enable. See
 +                      comma-separated list of trace events to enable. See
                        also Documentation/trace/events.rst
  
        trace_options=[option-list]
                        This option is obsoleted by the "nopv" option, which
                        has equivalent effect for XEN platform.
  
 +      xen_no_vector_callback
 +                      [KNL,X86,XEN] Disable the vector callback for Xen
 +                      event channel interrupts.
 +
        xen_scrub_pages=        [XEN]
                        Boolean option to control scrubbing pages before giving them back
                        to Xen, for use by other domains. Can be also changed at runtime
diff --combined include/linux/mm.h
index ecdf8a8cd6aebe62f49ae45bf7aab623b9e5282b,af7d050900e73eb0fbb6534ef568c451333ebdc3..fb1eba5700575c9741a5d200efd435a403a7216b
@@@ -216,13 -216,6 +216,13 @@@ int overcommit_kbytes_handler(struct ct
                loff_t *);
  int overcommit_policy_handler(struct ctl_table *, int, void *, size_t *,
                loff_t *);
 +/*
 + * Any attempt to mark this function as static leads to build failure
 + * when CONFIG_DEBUG_INFO_BTF is enabled because __add_to_page_cache_locked()
 + * is referred to by BPF code. This must be visible for error injection.
 + */
 +int __add_to_page_cache_locked(struct page *page, struct address_space *mapping,
 +              pgoff_t index, gfp_t gfp, void **shadowp);
  
  #define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n))
  
@@@ -2439,9 -2432,8 +2439,9 @@@ extern int __meminit early_pfn_to_nid(u
  #endif
  
  extern void set_dma_reserve(unsigned long new_dma_reserve);
 -extern void memmap_init_zone(unsigned long, int, unsigned long, unsigned long,
 -              enum meminit_context, struct vmem_altmap *, int migratetype);
 +extern void memmap_init_zone(unsigned long, int, unsigned long,
 +              unsigned long, unsigned long, enum meminit_context,
 +              struct vmem_altmap *, int migratetype);
  extern void setup_per_zone_wmarks(void);
  extern int __meminit init_per_zone_wmark_min(void);
  extern void mem_init(void);
@@@ -3177,5 -3169,7 +3177,7 @@@ unsigned long wp_shared_mapping_range(s
  
  extern int sysctl_nr_trim_pages;
  
+ void mem_dump_obj(void *object);
  #endif /* __KERNEL__ */
  #endif /* _LINUX_MM_H */
diff --combined include/linux/vmalloc.h
index cedcda6593f6134b239e640c44d3dbb5e000e5a0,c18f4751a704ab6985ef63f5b27cceb3422eb6ed..df92211cf7718f78a2e9a5cf394c1214a3fa4e3a
@@@ -24,8 -24,7 +24,8 @@@ struct notifier_block;                /* in notifier.
  #define VM_UNINITIALIZED      0x00000020      /* vm_struct is not fully initialized */
  #define VM_NO_GUARD           0x00000040      /* don't add guard page */
  #define VM_KASAN              0x00000080      /* has allocated kasan shadow memory */
 -#define VM_MAP_PUT_PAGES      0x00000100      /* put pages and free array in vfree */
 +#define VM_FLUSH_RESET_PERMS  0x00000100      /* reset direct map and flush TLB on unmap, can't be freed in atomic context */
 +#define VM_MAP_PUT_PAGES      0x00000200      /* put pages and free array in vfree */
  
  /*
   * VM_KASAN is used slighly differently depending on CONFIG_KASAN_VMALLOC.
   * determine which allocations need the module shadow freed.
   */
  
 -/*
 - * Memory with VM_FLUSH_RESET_PERMS cannot be freed in an interrupt or with
 - * vfree_atomic().
 - */
 -#define VM_FLUSH_RESET_PERMS  0x00000100      /* Reset direct map and flush TLB on unmap */
 -
  /* bits [20..32] reserved for arch specific ioremap internals */
  
  /*
@@@ -241,4 -246,10 +241,10 @@@ pcpu_free_vm_areas(struct vm_struct **v
  int register_vmap_purge_notifier(struct notifier_block *nb);
  int unregister_vmap_purge_notifier(struct notifier_block *nb);
  
+ #ifdef CONFIG_MMU
+ bool vmalloc_dump_obj(void *object);
+ #else
+ static inline bool vmalloc_dump_obj(void *object) { return false; }
+ #endif
  #endif /* _LINUX_VMALLOC_H */
diff --combined kernel/sched/core.c
index ff74fca39ed21693428e2f5276839581808c693b,a75c608839c4d6d52bd80157b85bb98234670091..22f6748c16f68111cef8a8da74a39d26fd860de4
@@@ -1796,28 -1796,13 +1796,28 @@@ static inline bool rq_has_pinned_tasks(
   */
  static inline bool is_cpu_allowed(struct task_struct *p, int cpu)
  {
 +      /* When not in the task's cpumask, no point in looking further. */
        if (!cpumask_test_cpu(cpu, p->cpus_ptr))
                return false;
  
 -      if (is_per_cpu_kthread(p) || is_migration_disabled(p))
 +      /* migrate_disabled() must be allowed to finish. */
 +      if (is_migration_disabled(p))
                return cpu_online(cpu);
  
 -      return cpu_active(cpu);
 +      /* Non kernel threads are not allowed during either online or offline. */
 +      if (!(p->flags & PF_KTHREAD))
 +              return cpu_active(cpu);
 +
 +      /* KTHREAD_IS_PER_CPU is always allowed. */
 +      if (kthread_is_per_cpu(p))
 +              return cpu_online(cpu);
 +
 +      /* Regular kernel threads don't get to stay during offline. */
 +      if (cpu_rq(cpu)->balance_push)
 +              return false;
 +
 +      /* But are allowed during online. */
 +      return cpu_online(cpu);
  }
  
  /*
@@@ -2342,9 -2327,7 +2342,9 @@@ static int __set_cpus_allowed_ptr(struc
  
        if (p->flags & PF_KTHREAD || is_migration_disabled(p)) {
                /*
 -               * Kernel threads are allowed on online && !active CPUs.
 +               * Kernel threads are allowed on online && !active CPUs,
 +               * however, during cpu-hot-unplug, even these might get pushed
 +               * away if not KTHREAD_IS_PER_CPU.
                 *
                 * Specifically, migration_disabled() tasks must not fail the
                 * cpumask_any_and_distribute() pick below, esp. so on
  
        __do_set_cpus_allowed(p, new_mask, flags);
  
 -      if (p->flags & PF_KTHREAD) {
 -              /*
 -               * For kernel threads that do indeed end up on online &&
 -               * !active we want to ensure they are strict per-CPU threads.
 -               */
 -              WARN_ON(cpumask_intersects(new_mask, cpu_online_mask) &&
 -                      !cpumask_intersects(new_mask, cpu_active_mask) &&
 -                      p->nr_cpus_allowed != 1);
 -      }
 -
        return affine_move_task(rq, p, &rf, dest_cpu, flags);
  
  out:
@@@ -3128,13 -3121,6 +3128,13 @@@ bool cpus_share_cache(int this_cpu, in
  
  static inline bool ttwu_queue_cond(int cpu, int wake_flags)
  {
 +      /*
 +       * Do not complicate things with the async wake_list while the CPU is
 +       * in hotplug state.
 +       */
 +      if (!cpu_active(cpu))
 +              return false;
 +
        /*
         * If the CPU does not share cache, then queue the task on the
         * remote rqs wakelist to avoid accessing remote data.
@@@ -3478,7 -3464,7 +3478,7 @@@ out
  
  /**
   * try_invoke_on_locked_down_task - Invoke a function on task in fixed state
-  * @p: Process for which the function is to be invoked.
+  * @p: Process for which the function is to be invoked, can be @current.
   * @func: Function to invoke.
   * @arg: Argument to function.
   *
   */
  bool try_invoke_on_locked_down_task(struct task_struct *p, bool (*func)(struct task_struct *t, void *arg), void *arg)
  {
-       bool ret = false;
        struct rq_flags rf;
+       bool ret = false;
        struct rq *rq;
  
-       lockdep_assert_irqs_enabled();
-       raw_spin_lock_irq(&p->pi_lock);
+       raw_spin_lock_irqsave(&p->pi_lock, rf.flags);
        if (p->on_rq) {
                rq = __task_rq_lock(p, &rf);
                if (task_rq(p) == rq)
                                ret = func(p, arg);
                }
        }
-       raw_spin_unlock_irq(&p->pi_lock);
+       raw_spin_unlock_irqrestore(&p->pi_lock, rf.flags);
        return ret;
  }
  
@@@ -7290,14 -7275,8 +7289,14 @@@ static void balance_push(struct rq *rq
        /*
         * Both the cpu-hotplug and stop task are in this case and are
         * required to complete the hotplug process.
 +       *
 +       * XXX: the idle task does not match kthread_is_per_cpu() due to
 +       * histerical raisins.
         */
 -      if (is_per_cpu_kthread(push_task) || is_migration_disabled(push_task)) {
 +      if (rq->idle == push_task ||
 +          ((push_task->flags & PF_KTHREAD) && kthread_is_per_cpu(push_task)) ||
 +          is_migration_disabled(push_task)) {
 +
                /*
                 * If this is the idle task on the outgoing CPU try to wake
                 * up the hotplug control thread which might wait for the
        /*
         * At this point need_resched() is true and we'll take the loop in
         * schedule(). The next pick is obviously going to be the stop task
 -       * which is_per_cpu_kthread() and will push this task away.
 +       * which kthread_is_per_cpu() and will push this task away.
         */
        raw_spin_lock(&rq->lock);
  }
@@@ -7340,13 -7319,10 +7339,13 @@@ static void balance_push_set(int cpu, b
        struct rq_flags rf;
  
        rq_lock_irqsave(rq, &rf);
 -      if (on)
 +      rq->balance_push = on;
 +      if (on) {
 +              WARN_ON_ONCE(rq->balance_callback);
                rq->balance_callback = &balance_push_callback;
 -      else
 +      } else if (rq->balance_callback == &balance_push_callback) {
                rq->balance_callback = NULL;
 +      }
        rq_unlock_irqrestore(rq, &rf);
  }
  
@@@ -7464,10 -7440,6 +7463,10 @@@ int sched_cpu_activate(unsigned int cpu
        struct rq *rq = cpu_rq(cpu);
        struct rq_flags rf;
  
 +      /*
 +       * Make sure that when the hotplug state machine does a roll-back
 +       * we clear balance_push. Ideally that would happen earlier...
 +       */
        balance_push_set(cpu, false);
  
  #ifdef CONFIG_SCHED_SMT
@@@ -7510,27 -7482,17 +7509,27 @@@ int sched_cpu_deactivate(unsigned int c
        int ret;
  
        set_cpu_active(cpu, false);
 +
 +      /*
 +       * From this point forward, this CPU will refuse to run any task that
 +       * is not: migrate_disable() or KTHREAD_IS_PER_CPU, and will actively
 +       * push those tasks away until this gets cleared, see
 +       * sched_cpu_dying().
 +       */
 +      balance_push_set(cpu, true);
 +
        /*
 -       * We've cleared cpu_active_mask, wait for all preempt-disabled and RCU
 -       * users of this state to go away such that all new such users will
 -       * observe it.
 +       * We've cleared cpu_active_mask / set balance_push, wait for all
 +       * preempt-disabled and RCU users of this state to go away such that
 +       * all new such users will observe it.
 +       *
 +       * Specifically, we rely on ttwu to no longer target this CPU, see
 +       * ttwu_queue_cond() and is_cpu_allowed().
         *
         * Do sync before park smpboot threads to take care the rcu boost case.
         */
        synchronize_rcu();
  
 -      balance_push_set(cpu, true);
 -
        rq_lock_irqsave(rq, &rf);
        if (rq->rd) {
                update_rq_clock(rq);
@@@ -7611,25 -7573,6 +7610,25 @@@ static void calc_load_migrate(struct r
                atomic_long_add(delta, &calc_load_tasks);
  }
  
 +static void dump_rq_tasks(struct rq *rq, const char *loglvl)
 +{
 +      struct task_struct *g, *p;
 +      int cpu = cpu_of(rq);
 +
 +      lockdep_assert_held(&rq->lock);
 +
 +      printk("%sCPU%d enqueued tasks (%u total):\n", loglvl, cpu, rq->nr_running);
 +      for_each_process_thread(g, p) {
 +              if (task_cpu(p) != cpu)
 +                      continue;
 +
 +              if (!task_on_rq_queued(p))
 +                      continue;
 +
 +              printk("%s\tpid: %d, name: %s\n", loglvl, p->pid, p->comm);
 +      }
 +}
 +
  int sched_cpu_dying(unsigned int cpu)
  {
        struct rq *rq = cpu_rq(cpu);
        sched_tick_stop(cpu);
  
        rq_lock_irqsave(rq, &rf);
 -      BUG_ON(rq->nr_running != 1 || rq_has_pinned_tasks(rq));
 +      if (rq->nr_running != 1 || rq_has_pinned_tasks(rq)) {
 +              WARN(true, "Dying CPU not properly vacated!");
 +              dump_rq_tasks(rq, KERN_WARNING);
 +      }
        rq_unlock_irqrestore(rq, &rf);
  
 +      /*
 +       * Now that the CPU is offline, make sure we're welcome
 +       * to new tasks once we come back up.
 +       */
 +      balance_push_set(cpu, false);
 +
        calc_load_migrate(rq);
        update_max_interval();
        nohz_balance_exit_idle(rq);
diff --combined mm/slub.c
index b22a4b101c846ea651e34b271280803a45fee867,3c1a84316fd7dcf467c5b1b32bc145ded994b3f1..f5baf429654f24d6dc056f1edeab02a00f7b9f39
+++ b/mm/slub.c
@@@ -1619,6 -1619,9 +1619,6 @@@ static inline struct page *alloc_slab_p
        else
                page = __alloc_pages_node(node, flags, order);
  
 -      if (page)
 -              account_slab_page(page, order, s);
 -
        return page;
  }
  
@@@ -1771,8 -1774,6 +1771,8 @@@ static struct page *allocate_slab(struc
  
        page->objects = oo_objects(oo);
  
 +      account_slab_page(page, oo_order(oo), s);
 +
        page->slab_cache = s;
        __SetPageSlab(page);
        if (page_is_pfmemalloc(page))
@@@ -1973,7 -1974,7 +1973,7 @@@ static void *get_partial_node(struct km
  
                t = acquire_slab(s, n, page, object == NULL, &objects);
                if (!t)
 -                      break;
 +                      continue; /* cmpxchg raced */
  
                available += objects;
                if (!object) {
@@@ -2791,8 -2792,7 +2791,8 @@@ static __always_inline void maybe_wipe_
                                                   void *obj)
  {
        if (unlikely(slab_want_init_on_free(s)) && obj)
 -              memset((void *)((char *)obj + s->offset), 0, sizeof(void *));
 +              memset((void *)((char *)kasan_reset_tag(obj) + s->offset),
 +                      0, sizeof(void *));
  }
  
  /*
@@@ -2884,7 -2884,7 +2884,7 @@@ redo
                stat(s, ALLOC_FASTPATH);
        }
  
 -      maybe_wipe_obj_freeptr(s, kasan_reset_tag(object));
 +      maybe_wipe_obj_freeptr(s, object);
  
        if (unlikely(slab_want_init_on_alloc(gfpflags, s)) && object)
                memset(kasan_reset_tag(object), 0, s->object_size);
@@@ -3330,7 -3330,7 +3330,7 @@@ int kmem_cache_alloc_bulk(struct kmem_c
                int j;
  
                for (j = 0; j < i; j++)
 -                      memset(p[j], 0, s->object_size);
 +                      memset(kasan_reset_tag(p[j]), 0, s->object_size);
        }
  
        /* memcg and kmem_cache debug support */
@@@ -3423,7 -3423,6 +3423,7 @@@ static inline int calculate_order(unsig
        unsigned int order;
        unsigned int min_objects;
        unsigned int max_objects;
 +      unsigned int nr_cpus;
  
        /*
         * Attempt to find best configuration for a slab. This
         * we reduce the minimum objects required in a slab.
         */
        min_objects = slub_min_objects;
 -      if (!min_objects)
 -              min_objects = 4 * (fls(num_online_cpus()) + 1);
 +      if (!min_objects) {
 +              /*
 +               * Some architectures will only update present cpus when
 +               * onlining them, so don't trust the number if it's just 1. But
 +               * we also don't want to use nr_cpu_ids always, as on some other
 +               * architectures, there can be many possible cpus, but never
 +               * onlined. Here we compromise between trying to avoid too high
 +               * order on systems that appear larger than they are, and too
 +               * low order on systems that appear smaller than they are.
 +               */
 +              nr_cpus = num_present_cpus();
 +              if (nr_cpus <= 1)
 +                      nr_cpus = nr_cpu_ids;
 +              min_objects = 4 * (fls(nr_cpus) + 1);
 +      }
        max_objects = order_objects(slub_max_order, size);
        min_objects = min(min_objects, max_objects);
  
@@@ -3933,6 -3919,46 +3933,46 @@@ int __kmem_cache_shutdown(struct kmem_c
        return 0;
  }
  
+ void kmem_obj_info(struct kmem_obj_info *kpp, void *object, struct page *page)
+ {
+       void *base;
+       int __maybe_unused i;
+       unsigned int objnr;
+       void *objp;
+       void *objp0;
+       struct kmem_cache *s = page->slab_cache;
+       struct track __maybe_unused *trackp;
+       kpp->kp_ptr = object;
+       kpp->kp_page = page;
+       kpp->kp_slab_cache = s;
+       base = page_address(page);
+       objp0 = kasan_reset_tag(object);
+ #ifdef CONFIG_SLUB_DEBUG
+       objp = restore_red_left(s, objp0);
+ #else
+       objp = objp0;
+ #endif
+       objnr = obj_to_index(s, page, objp);
+       kpp->kp_data_offset = (unsigned long)((char *)objp0 - (char *)objp);
+       objp = base + s->size * objnr;
+       kpp->kp_objp = objp;
+       if (WARN_ON_ONCE(objp < base || objp >= base + page->objects * s->size || (objp - base) % s->size) ||
+           !(s->flags & SLAB_STORE_USER))
+               return;
+ #ifdef CONFIG_SLUB_DEBUG
+       trackp = get_track(s, objp, TRACK_ALLOC);
+       kpp->kp_ret = (void *)trackp->addr;
+ #ifdef CONFIG_STACKTRACE
+       for (i = 0; i < KS_ADDRS_COUNT && i < TRACK_ADDRS_COUNT; i++) {
+               kpp->kp_stack[i] = (void *)trackp->addrs[i];
+               if (!kpp->kp_stack[i])
+                       break;
+       }
+ #endif
+ #endif
+ }
  /********************************************************************
   *            Kmalloc subsystem
   *******************************************************************/
@@@ -5639,8 -5665,10 +5679,8 @@@ static int sysfs_slab_add(struct kmem_c
  
        s->kobj.kset = kset;
        err = kobject_init_and_add(&s->kobj, &slab_ktype, NULL, "%s", name);
 -      if (err) {
 -              kobject_put(&s->kobj);
 +      if (err)
                goto out;
 -      }
  
        err = sysfs_create_group(&s->kobj, &slab_attr_group);
        if (err)
diff --combined mm/vmalloc.c
index e6f352bf0498248a5f36c991f56c80ac9cf290c3,e3229ff627ea06523a2771de7308ced4f25ca78c..4f5f8c907897aeb51c5c09272ad802eaad8eb320
@@@ -2420,10 -2420,8 +2420,10 @@@ void *vmap(struct page **pages, unsigne
                return NULL;
        }
  
 -      if (flags & VM_MAP_PUT_PAGES)
 +      if (flags & VM_MAP_PUT_PAGES) {
                area->pages = pages;
 +              area->nr_pages = count;
 +      }
        return area->addr;
  }
  EXPORT_SYMBOL(vmap);
@@@ -3450,6 -3448,19 +3450,19 @@@ void pcpu_free_vm_areas(struct vm_struc
  }
  #endif        /* CONFIG_SMP */
  
+ bool vmalloc_dump_obj(void *object)
+ {
+       struct vm_struct *vm;
+       void *objp = (void *)PAGE_ALIGN((unsigned long)object);
+       vm = find_vm_area(objp);
+       if (!vm)
+               return false;
+       pr_cont(" %u-page vmalloc region starting at %#lx allocated at %pS\n",
+               vm->nr_pages, (unsigned long)vm->addr, vm->caller);
+       return true;
+ }
  #ifdef CONFIG_PROC_FS
  static void *s_start(struct seq_file *m, loff_t *pos)
        __acquires(&vmap_purge_lock)
This page took 0.254651 seconds and 4 git commands to generate.