summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMatthew Wilcox <willy@infradead.org>2016-12-14 15:08:34 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2016-12-14 16:04:10 -0800
commit91d9c05ac6c788531136888d31ef18c6a0ec160f (patch)
tree858de508527dbe571ca87a77d572a38ebf92b55d /lib
parent91b9677c4c1242a3d0afd76d0e91f43808243b92 (diff)
downloadlinux-91d9c05ac6c788531136888d31ef18c6a0ec160f.tar.gz
linux-91d9c05ac6c788531136888d31ef18c6a0ec160f.tar.bz2
linux-91d9c05ac6c788531136888d31ef18c6a0ec160f.zip
radix-tree: move rcu_head into a union with private_list
I want to be able to reference node->parent after freeing node. Currently node->parent is in a union with rcu_head, so it is overwritten when the node is put on the RCU list. We know that private_list is not referenced after the node is freed, so it is safe for these two members to share space. Link: http://lkml.kernel.org/r/1480369871-5271-50-git-send-email-mawilcox@linuxonhyperv.com Signed-off-by: Matthew Wilcox <willy@infradead.org> Tested-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Konstantin Khlebnikov <koct9i@gmail.com> Cc: Ross Zwisler <ross.zwisler@linux.intel.com> Cc: Matthew Wilcox <mawilcox@microsoft.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/radix-tree.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/radix-tree.c b/lib/radix-tree.c
index 60c10361cbfa..8c5911eae5e2 100644
--- a/lib/radix-tree.c
+++ b/lib/radix-tree.c
@@ -325,6 +325,7 @@ static void radix_tree_node_rcu_free(struct rcu_head *head)
tag_clear(node, i, 0);
node->slots[0] = NULL;
+ INIT_LIST_HEAD(&node->private_list);
kmem_cache_free(radix_tree_node_cachep, node);
}