diff options
author | David S. Miller <davem@davemloft.net> | 2009-07-17 04:34:50 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-07-17 04:34:50 +0400 |
commit | 95aa1fe4abfc8d75dcd110bb285b09740214d053 (patch) | |
tree | 668998047f77fe5d7f76ecbceec73a4f4c8311a6 /Documentation | |
parent | b13bb2e9933b9dfa25c81d959d847c843481111e (diff) | |
parent | 941297f443f871b8c3372feccf27a8733f6ce9e9 (diff) | |
download | linux-95aa1fe4abfc8d75dcd110bb285b09740214d053.tar.xz |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-2.6
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/RCU/rculist_nulls.txt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Documentation/RCU/rculist_nulls.txt b/Documentation/RCU/rculist_nulls.txt index 93cb28d05dcd..18f9651ff23d 100644 --- 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; -atomic_inc(&obj->refcnt); /* * we need to make sure obj->key is updated before obj->next + * or obj->refcnt */ smp_wmb(); +atomic_set(&obj->refcnt, 1); 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; +/* + * 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) |