projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
blkcg: implement interface for the unified hierarchy
[firefly-linux-kernel-4.4.55.git]
/
Documentation
/
RCU
/
rculist_nulls.txt
diff --git
a/Documentation/RCU/rculist_nulls.txt
b/Documentation/RCU/rculist_nulls.txt
index 93cb28d05dcd92da30dde47ec58205e2b0851022..18f9651ff23d411e96737ec070d4fc6bc29c50fe 100644
(file)
--- a/
Documentation/RCU/rculist_nulls.txt
+++ b/
Documentation/RCU/rculist_nulls.txt
@@
-83,11
+83,12
@@
not detect it missed following items in original chain.
obj = kmem_cache_alloc(...);
lock_chain(); // typically a spin_lock()
obj->key = key;
obj = kmem_cache_alloc(...);
lock_chain(); // typically a spin_lock()
obj->key = key;
-atomic_inc(&obj->refcnt);
/*
* we need to make sure obj->key is updated before obj->next
/*
* we need to make sure obj->key is updated before obj->next
+ * or obj->refcnt
*/
smp_wmb();
*/
smp_wmb();
+atomic_set(&obj->refcnt, 1);
hlist_add_head_rcu(&obj->obj_node, list);
unlock_chain(); // typically a spin_unlock()
hlist_add_head_rcu(&obj->obj_node, list);
unlock_chain(); // typically a spin_unlock()
@@
-159,6
+160,10
@@
out:
obj = kmem_cache_alloc(cachep);
lock_chain(); // typically a spin_lock()
obj->key = key;
obj = kmem_cache_alloc(cachep);
lock_chain(); // typically a spin_lock()
obj->key = key;
+/*
+ * changes to obj->key must be visible before refcnt one
+ */
+smp_wmb();
atomic_set(&obj->refcnt, 1);
/*
* insert obj in RCU way (readers might be traversing chain)
atomic_set(&obj->refcnt, 1);
/*
* insert obj in RCU way (readers might be traversing chain)