linux-stable/Documentation/RCU
Paul E. McKenney 1f3ebc8253 rcu: Restore barrier() to rcu_read_lock() and rcu_read_unlock()
Commit bb73c52bad ("rcu: Don't disable preemption for Tiny and Tree
RCU readers") removed the barrier() calls from rcu_read_lock() and
rcu_write_lock() in CONFIG_PREEMPT=n&&CONFIG_PREEMPT_COUNT=n kernels.
Within RCU, this commit was OK, but it failed to account for things like
get_user() that can pagefault and that can be reordered by the compiler.
Lack of the barrier() calls in rcu_read_lock() and rcu_read_unlock()
can cause these page faults to migrate into RCU read-side critical
sections, which in CONFIG_PREEMPT=n kernels could result in too-short
grace periods and arbitrary misbehavior.  Please see commit 386afc9114
("spinlocks and preemption points need to be at least compiler barriers")
and Linus's commit 66be4e66a7 ("rcu: locking and unlocking need to
always be at least barriers"), this last of which restores the barrier()
call to both rcu_read_lock() and rcu_read_unlock().

This commit removes barrier() calls that are no longer needed given that
the addition of them in Linus's commit noted above.  The combination of
this commit and Linus's commit effectively reverts commit bb73c52bad
("rcu: Don't disable preemption for Tiny and Tree RCU readers").

Reported-by: Herbert Xu <herbert@gondor.apana.org.au>
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
[ paulmck: Fix embarrassing typo located by Alan Stern. ]
2019-08-01 14:05:51 -07:00
..
Design rcu: Restore barrier() to rcu_read_lock() and rcu_read_unlock() 2019-08-01 14:05:51 -07:00
arrayRCU.txt documentation: RCU-protected array indexes no longer supported 2015-05-27 12:56:17 -07:00
checklist.txt doc: Fix typos and otherwise modernize checklist.txt 2019-03-26 14:37:06 -07:00
index.rst Documentation: RCU: Add TOC tree hooks 2019-06-27 08:19:08 -06:00
listRCU.rst Documentation: RCU: Rename txt files to rst 2019-06-27 08:19:02 -06:00
lockdep-splat.txt Documentation/locking/lockdep: Drop last two chars of sample states 2019-03-04 12:55:18 -07:00
lockdep.txt documentation: RCU-protected array indexes no longer supported 2015-05-27 12:56:17 -07:00
NMI-RCU.txt doc: Remove obsolete RCU update functions from RCU documentation 2019-03-26 14:37:06 -07:00
rcu.rst Documentation: RCU: Rename txt files to rst 2019-06-27 08:19:02 -06:00
rcu_dereference.txt doc: Describe choice of rcu_dereference() APIs and __rcu usage 2019-03-26 14:37:06 -07:00
rcubarrier.txt doc: Remove obsolete RCU update functions from RCU documentation 2019-03-26 14:37:06 -07:00
rculist_nulls.txt docs: fix broken doc references due to renames 2019-07-17 06:57:51 -03:00
rcuref.txt doc/rcuref: Document real world examples in kernel 2019-05-28 09:02:16 -07:00
RTFP.txt Documentation: fix common spelling mistakes 2016-04-28 07:51:59 -06:00
stallwarn.txt doc: Fixup definition of rcupdate.rcu_task_stall_timeout 2019-05-28 09:02:16 -07:00
torture.txt RCU/torture.txt: Remove section MODULE PARAMETERS 2019-01-25 15:37:14 -08:00
UP.rst doc: RCU callback locks need only _bh, not necessarily _irq 2019-06-28 09:10:40 -06:00
whatisRCU.txt rcu: Don't return a value from rcu_assign_pointer() 2019-06-13 15:38:34 -07:00