Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 41a2901e authored by Paul E. McKenney's avatar Paul E. McKenney
Browse files

rcu: Remove SPARSE_RCU_POINTER Kconfig option



The sparse-based checking for non-RCU accesses to RCU-protected pointers
has been around for a very long time, and it is now the only type of
sparse-based checking that is optional.  This commit therefore makes
it unconditional.

Reported-by: default avatarIngo Molnar <mingo@kernel.org>
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Fengguang Wu <fengguang.wu@intel.com>
parent c4a09ff7
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -559,9 +559,7 @@ The <tt>rcu_access_pointer()</tt> on line&nbsp;6 is similar to
	For <tt>remove_gp_synchronous()</tt>, as long as all modifications
	to <tt>gp</tt> are carried out while holding <tt>gp_lock</tt>,
	the above optimizations are harmless.
	However,
	with <tt>CONFIG_SPARSE_RCU_POINTER=y</tt>,
	<tt>sparse</tt> will complain if you
	However, <tt>sparse</tt> will complain if you
	define <tt>gp</tt> with <tt>__rcu</tt> and then
	access it without using
	either <tt>rcu_access_pointer()</tt> or <tt>rcu_dereference()</tt>.
@@ -1978,9 +1976,8 @@ guard against mishaps and misuse:
	and <tt>rcu_dereference()</tt>, perhaps (incorrectly)
	substituting a simple assignment.
	To catch this sort of error, a given RCU-protected pointer may be
	tagged with <tt>__rcu</tt>, after which running sparse
	with <tt>CONFIG_SPARSE_RCU_POINTER=y</tt> will complain
	about simple-assignment accesses to that pointer.
	tagged with <tt>__rcu</tt>, 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
	<a href="https://lwn.net/Articles/376011/">patch series</a>.
+4 −4
Original line number Diff line number Diff line
@@ -413,11 +413,11 @@ over a rather long period of time, but improvements are always welcome!
	read-side critical sections.  It is the responsibility of the
	RCU update-side primitives to deal with this.

17.	Use CONFIG_PROVE_RCU, CONFIG_DEBUG_OBJECTS_RCU_HEAD, and the
	__rcu sparse checks (enabled by CONFIG_SPARSE_RCU_POINTER) to
	validate your RCU code.  These can help find problems as follows:
17.	Use CONFIG_PROVE_LOCKING, CONFIG_DEBUG_OBJECTS_RCU_HEAD, and the
	__rcu sparse checks to validate your RCU code.	These can help
	find problems as follows:

	CONFIG_PROVE_RCU: check that accesses to RCU-protected data
	CONFIG_PROVE_LOCKING: check that accesses to RCU-protected data
		structures are carried out under the proper RCU
		read-side critical section, while holding the right
		combination of locks, or whatever other conditions
+0 −6
Original line number Diff line number Diff line
@@ -103,9 +103,3 @@ have already built it.

The optional make variable CF can be used to pass arguments to sparse.  The
build system passes -Wbitwise to sparse automatically.

Checking RCU annotations
~~~~~~~~~~~~~~~~~~~~~~~~

RCU annotations are not checked by default.  To enable RCU annotation
checks, include -DCONFIG_SPARSE_RCU_POINTER in your CF flags.
+0 −4
Original line number Diff line number Diff line
@@ -17,11 +17,7 @@
# define __release(x)	__context__(x,-1)
# define __cond_lock(x,c)	((c) ? ({ __acquire(x); 1; }) : 0)
# define __percpu	__attribute__((noderef, address_space(3)))
#ifdef CONFIG_SPARSE_RCU_POINTER
# define __rcu		__attribute__((noderef, address_space(4)))
#else /* CONFIG_SPARSE_RCU_POINTER */
# define __rcu
#endif /* CONFIG_SPARSE_RCU_POINTER */
# define __private	__attribute__((noderef))
extern void __chk_user_ptr(const volatile void __user *);
extern void __chk_io_ptr(const volatile void __iomem *);
+0 −15
Original line number Diff line number Diff line
@@ -1306,21 +1306,6 @@ menu "RCU Debugging"
config PROVE_RCU
	def_bool PROVE_LOCKING

config SPARSE_RCU_POINTER
	bool "RCU debugging: sparse-based checks for pointer usage"
	default n
	help
	 This feature enables the __rcu sparse annotation for
	 RCU-protected pointers.  This annotation will cause sparse
	 to flag any non-RCU used of annotated pointers.  This can be
	 helpful when debugging RCU usage.  Please note that this feature
	 is not intended to enforce code cleanliness; it is instead merely
	 a debugging aid.

	 Say Y to make sparse flag questionable use of RCU-protected pointers

	 Say N if you are unsure.

config TORTURE_TEST
	tristate
	default n
Loading