Skip to contentSkip to conversation

net: add RCU annotation to sk_dst_cache field

PATCH In review Cong Wang 4 participants 7 messages Jan 23, 2013

Subsystems (3)
lore
Share & tools
lore

Cong Wang

author
#0 lore raw

PATCH 1/1 net: add RCU annotation to sk_dst_cache field

From: Cong Wang <[email protected]>

sock->sk_dst_cache is protected by RCU.

---

include/net/sock.h +1 -1
index 5a34e2f..c4b64c6 100644
@@ -337,7 +337,7 @@ struct sock {
 #endif
 	unsigned long 		sk_flags;
 	struct dst_entry	*sk_rx_dst;
-	struct dst_entry	*sk_dst_cache;
+	struct dst_entry __rcu	*sk_dst_cache;
 	spinlock_t		sk_dst_lock;
 	atomic_t		sk_wmem_alloc;
 	atomic_t		sk_omem_alloc;
#1 lore raw
Quoted 14 lines · Cong Wang

From: Cong Wang <[email protected]>

sock->sk_dst_cache is protected by RCU.

---

include/net/sock.h +0 -0
index 5a34e2f..c4b64c6 100644

include/net/sock.h struct sock { · line 343

Quoted 8 lines
include/net/sock.h +1 -1
@@ -337,7 +337,7 @@ struct sock {
 #endif
 	unsigned long 		sk_flags;
 	struct dst_entry	*sk_rx_dst;
-	struct dst_entry	*sk_dst_cache;
+	struct dst_entry __rcu	*sk_dst_cache;
 	spinlock_t		sk_dst_lock;
 	atomic_t		sk_wmem_alloc;
 	atomic_t		sk_omem_alloc;

Thats not a complete patch.

You'll have to fix the errors it brings.

author
#2 lore raw
Quoted 26 lines · Eric Dumazet
Quoted 14 lines · Cong Wang

From: Cong Wang <[email protected]>

sock->sk_dst_cache is protected by RCU.

---

include/net/sock.h +0 -0
index 5a34e2f..c4b64c6 100644

include/net/sock.h struct sock { · line 343

Quoted 8 lines
include/net/sock.h +1 -1
@@ -337,7 +337,7 @@ struct sock {
 #endif
 	unsigned long 		sk_flags;
 	struct dst_entry	*sk_rx_dst;
-	struct dst_entry	*sk_dst_cache;
+	struct dst_entry __rcu	*sk_dst_cache;
 	spinlock_t		sk_dst_lock;
 	atomic_t		sk_wmem_alloc;
 	atomic_t		sk_omem_alloc;

Thats not a complete patch.

Quoted 1 line

You'll have to fix the errors it brings.

It does fix this warning:

net/core/flow_dissector.c:280:37: sparse: incompatible types in comparison expression (different address spaces)

#3 lore raw
Quoted 4 lines · Cong Wang

It does fix this warning:

net/core/flow_dissector.c:280:37: sparse: incompatible types in comparison expression (different address spaces)

Thats not a good enough reason.

It adds 10 new warnings.

author
#4 lore raw
Quoted 12 lines · Eric Dumazet
Quoted 4 lines · Cong Wang

It does fix this warning:

net/core/flow_dissector.c:280:37: sparse: incompatible types in comparison expression (different address spaces)

Thats not a good enough reason.

It adds 10 new warnings.

I expect most of them are from decnet, which is (partially) deprecated?

#5 lore raw
Quoted 2 lines · Cong Wang

I expect most of them are from decnet, which is (partially) deprecated?

How many answers to you want exactly from me ?

maintainer
#6 lore raw
In reply to Cong Wang

From: Cong Wang <[email protected]>
Date: Wed, 23 Jan 2013 13:30:57 +0800

Quoted 1 line

I expect most of them are from decnet, which is (partially) deprecated?

decnet is not deprecated, people use and test it, just fix the warnings, implement your patch properly, and stop arguing.