From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: David Howells <dhowells@redhat.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 22/24] rcu: Suppress sparse warnings for rcu_dereference_raw()
Date: Tue, 5 Jul 2016 14:32:44 -0700 [thread overview]
Message-ID: <20160705213244.GA12384@linux.vnet.ibm.com> (raw)
In-Reply-To: <146772448920.21657.6989233498278959646.stgit@warthog.procyon.org.uk>
On Tue, Jul 05, 2016 at 02:14:49PM +0100, David Howells wrote:
> From: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
>
> Data structures that are used both with and without RCU protection
> are difficult to write in a sparse-clean manner. If you mark the
> relevant pointers with __rcu, sparse will complain about all non-RCU
> uses, but if you don't mark those pointers, sparse will complain about
> all RCU uses.
>
> This commit therefore suppresses sparse warnings for rcu_dereference_raw(),
> allowing mixed-protection data structures to avoid these warnings.
>
> Reported-by: David Howells <dhowells@redhat.com>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> Signed-off-by: David Howells <dhowells@redhat.com>
This would normally be my cue to give an Acked-by to an RCU patch, but
it already has my Signed-off-by. So this is just to confirm that I agree
that keeping this patch with the other patches that depend on it is the
right thing to do. ;-)
Thanx, Paul
> ---
>
> include/linux/rcupdate.h | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
> index 5f1533e3d032..85830e6c797b 100644
> --- a/include/linux/rcupdate.h
> +++ b/include/linux/rcupdate.h
> @@ -611,6 +611,12 @@ static inline void rcu_preempt_sleep_check(void)
> rcu_dereference_sparse(p, space); \
> ((typeof(*p) __force __kernel *)(p)); \
> })
> +#define rcu_dereference_raw(p) \
> +({ \
> + /* Dependency order vs. p above. */ \
> + typeof(p) ________p1 = lockless_dereference(p); \
> + ((typeof(*p) __force __kernel *)(________p1)); \
> +})
>
> /**
> * RCU_INITIALIZER() - statically initialize an RCU-protected global variable
> @@ -729,8 +735,6 @@ static inline void rcu_preempt_sleep_check(void)
> __rcu_dereference_check((p), (c) || rcu_read_lock_sched_held(), \
> __rcu)
>
> -#define rcu_dereference_raw(p) rcu_dereference_check(p, 1) /*@@@ needed? @@@*/
> -
> /*
> * The tracing infrastructure traces RCU (we want that), but unfortunately
> * some of the RCU checks causes tracing to lock up the system.
>
next prev parent reply other threads:[~2016-07-05 21:32 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-05 13:12 [PATCH net-next 00/24] rxrpc: Improve conn/call lookup and fix call number generation [ver #2] David Howells
2016-07-05 13:12 ` [PATCH net-next 01/24] rxrpc: Fix processing of authenticated/encrypted jumbo packets David Howells
2016-07-05 17:55 ` Sergei Shtylyov
2016-07-05 19:26 ` David Howells
2016-07-05 13:12 ` [PATCH net-next 02/24] rxrpc: Fix some sparse errors David Howells
2016-07-05 13:12 ` [PATCH net-next 03/24] rxrpc: Check the source of a packet to a client conn David Howells
2016-07-05 13:12 ` [PATCH net-next 04/24] rxrpc: Avoid using stack memory in SG lists in rxkad David Howells
2016-07-06 13:19 ` Andy Lutomirski
2016-07-06 15:03 ` David Howells
2016-07-05 13:12 ` [PATCH net-next 05/24] rxrpc: Provide more refcount helper functions David Howells
2016-07-05 17:16 ` David Miller
2016-07-05 19:15 ` David Howells
2016-07-05 19:50 ` David Howells
2016-07-05 13:12 ` [PATCH net-next 06/24] rxrpc: Dup the main conn list for the proc interface David Howells
2016-07-05 17:17 ` David Miller
2016-07-05 19:21 ` David Howells
2016-07-05 19:53 ` David Howells
2016-07-05 13:13 ` [PATCH net-next 07/24] rxrpc: Turn connection #defines into enums and put outside struct def David Howells
2016-07-05 13:13 ` [PATCH net-next 08/24] rxrpc: Check that the client conns cache is empty before module removal David Howells
2016-07-05 13:13 ` [PATCH net-next 09/24] rxrpc: Move usage count getting into rxrpc_queue_conn() David Howells
2016-07-05 13:13 ` [PATCH net-next 10/24] rxrpc: Fix handling of connection failure in client call creation David Howells
2016-07-05 13:13 ` [PATCH net-next 11/24] rxrpc: Release a call's connection ref on call disconnection David Howells
2016-07-05 13:13 ` [PATCH net-next 12/24] rxrpc: Add RCU destruction for connections and calls David Howells
2016-07-05 13:13 ` [PATCH net-next 13/24] rxrpc: Access socket accept queue under right lock David Howells
2016-07-05 13:13 ` [PATCH net-next 14/24] rxrpc: Call channels should have separate call number spaces David Howells
2016-07-05 13:13 ` [PATCH net-next 15/24] rxrpc: Split client connection code out into its own file David Howells
2016-07-05 13:14 ` [PATCH net-next 16/24] rxrpc: Split service " David Howells
2016-07-05 13:14 ` [PATCH net-next 17/24] rxrpc: Move peer lookup from call-accept to new-incoming-conn David Howells
2016-07-05 13:14 ` [PATCH net-next 18/24] rxrpc: Maintain an extra ref on a conn for the cache list David Howells
2016-07-05 13:14 ` [PATCH net-next 19/24] rxrpc: Prune the contents of the rxrpc_conn_proto struct David Howells
2016-07-05 13:14 ` [PATCH net-next 20/24] rxrpc: Move data_ready peer lookup into rxrpc_find_connection() David Howells
2016-07-05 13:14 ` [PATCH net-next 21/24] Introduce rb_replace_node_rcu() David Howells
2016-07-05 13:14 ` [PATCH net-next 22/24] rcu: Suppress sparse warnings for rcu_dereference_raw() David Howells
2016-07-05 21:32 ` Paul E. McKenney [this message]
2016-07-05 13:14 ` [PATCH net-next 23/24] rxrpc: Use RCU to access a peer's service connection tree David Howells
2016-07-05 13:15 ` [PATCH net-next 24/24] rxrpc: Kill off the call hash table David Howells
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160705213244.GA12384@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--cc=linux-afs@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).