summaryrefslogtreecommitdiffstats
path: root/net/llc
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2017-01-18 05:53:44 -0500
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2017-04-18 14:42:36 -0400
commit5f0d5a3ae7cff0d7fa943c199c3a2e44f23e1fac (patch)
treeb7ba2116923723e193dfe7c633ec10056c6b1b53 /net/llc
parent4495c08e84729385774601b5146d51d9e5849f81 (diff)
mm: Rename SLAB_DESTROY_BY_RCU to SLAB_TYPESAFE_BY_RCU
A group of Linux kernel hackers reported chasing a bug that resulted from their assumption that SLAB_DESTROY_BY_RCU provided an existence guarantee, that is, that no block from such a slab would be reallocated during an RCU read-side critical section. Of course, that is not the case. Instead, SLAB_DESTROY_BY_RCU only prevents freeing of an entire slab of blocks. However, there is a phrase for this, namely "type safety". This commit therefore renames SLAB_DESTROY_BY_RCU to SLAB_TYPESAFE_BY_RCU in order to avoid future instances of this sort of confusion. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Christoph Lameter <cl@linux.com> Cc: Pekka Enberg <penberg@kernel.org> Cc: David Rientjes <rientjes@google.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: <linux-mm@kvack.org> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Acked-by: Vlastimil Babka <vbabka@suse.cz> [ paulmck: Add comments mentioning the old name, as requested by Eric Dumazet, in order to help people familiar with the old name find the new one. ] Acked-by: David Rientjes <rientjes@google.com>
Diffstat (limited to 'net/llc')
-rw-r--r--net/llc/af_llc.c2
-rw-r--r--net/llc/llc_conn.c4
-rw-r--r--net/llc/llc_sap.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c
index 06186d608a27..d096ca563054 100644
--- a/net/llc/af_llc.c
+++ b/net/llc/af_llc.c
@@ -142,7 +142,7 @@ static struct proto llc_proto = {
142 .name = "LLC", 142 .name = "LLC",
143 .owner = THIS_MODULE, 143 .owner = THIS_MODULE,
144 .obj_size = sizeof(struct llc_sock), 144 .obj_size = sizeof(struct llc_sock),
145 .slab_flags = SLAB_DESTROY_BY_RCU, 145 .slab_flags = SLAB_TYPESAFE_BY_RCU,
146}; 146};
147 147
148/** 148/**
diff --git a/net/llc/llc_conn.c b/net/llc/llc_conn.c
index 8bc5a1bd2d45..9b02c13d258b 100644
--- a/net/llc/llc_conn.c
+++ b/net/llc/llc_conn.c
@@ -506,7 +506,7 @@ static struct sock *__llc_lookup_established(struct llc_sap *sap,
506again: 506again:
507 sk_nulls_for_each_rcu(rc, node, laddr_hb) { 507 sk_nulls_for_each_rcu(rc, node, laddr_hb) {
508 if (llc_estab_match(sap, daddr, laddr, rc)) { 508 if (llc_estab_match(sap, daddr, laddr, rc)) {
509 /* Extra checks required by SLAB_DESTROY_BY_RCU */ 509 /* Extra checks required by SLAB_TYPESAFE_BY_RCU */
510 if (unlikely(!atomic_inc_not_zero(&rc->sk_refcnt))) 510 if (unlikely(!atomic_inc_not_zero(&rc->sk_refcnt)))
511 goto again; 511 goto again;
512 if (unlikely(llc_sk(rc)->sap != sap || 512 if (unlikely(llc_sk(rc)->sap != sap ||
@@ -565,7 +565,7 @@ static struct sock *__llc_lookup_listener(struct llc_sap *sap,
565again: 565again:
566 sk_nulls_for_each_rcu(rc, node, laddr_hb) { 566 sk_nulls_for_each_rcu(rc, node, laddr_hb) {
567 if (llc_listener_match(sap, laddr, rc)) { 567 if (llc_listener_match(sap, laddr, rc)) {
568 /* Extra checks required by SLAB_DESTROY_BY_RCU */ 568 /* Extra checks required by SLAB_TYPESAFE_BY_RCU */
569 if (unlikely(!atomic_inc_not_zero(&rc->sk_refcnt))) 569 if (unlikely(!atomic_inc_not_zero(&rc->sk_refcnt)))
570 goto again; 570 goto again;
571 if (unlikely(llc_sk(rc)->sap != sap || 571 if (unlikely(llc_sk(rc)->sap != sap ||
diff --git a/net/llc/llc_sap.c b/net/llc/llc_sap.c
index 5404d0d195cc..63b6ab056370 100644
--- a/net/llc/llc_sap.c
+++ b/net/llc/llc_sap.c
@@ -328,7 +328,7 @@ static struct sock *llc_lookup_dgram(struct llc_sap *sap,
328again: 328again:
329 sk_nulls_for_each_rcu(rc, node, laddr_hb) { 329 sk_nulls_for_each_rcu(rc, node, laddr_hb) {
330 if (llc_dgram_match(sap, laddr, rc)) { 330 if (llc_dgram_match(sap, laddr, rc)) {
331 /* Extra checks required by SLAB_DESTROY_BY_RCU */ 331 /* Extra checks required by SLAB_TYPESAFE_BY_RCU */
332 if (unlikely(!atomic_inc_not_zero(&rc->sk_refcnt))) 332 if (unlikely(!atomic_inc_not_zero(&rc->sk_refcnt)))
333 goto again; 333 goto again;
334 if (unlikely(llc_sk(rc)->sap != sap || 334 if (unlikely(llc_sk(rc)->sap != sap ||