diff options
author | Matthew Wilcox <mawilcox@microsoft.com> | 2017-01-16 23:10:21 +0100 |
---|---|---|
committer | Matthew Wilcox <mawilcox@microsoft.com> | 2017-02-14 03:44:05 +0100 |
commit | d58275bc96ae933b1b3888af80920dd6b020c505 (patch) | |
tree | e1acf252dc43eeb1d65e4f715b0a1d52b1b4af09 /mm | |
parent | radix-tree: Chain preallocated nodes through ->parent (diff) | |
download | linux-d58275bc96ae933b1b3888af80920dd6b020c505.tar.xz linux-d58275bc96ae933b1b3888af80920dd6b020c505.zip |
radix-tree: Store a pointer to the root in each node
Instead of having this mysterious private_data in each radix_tree_node,
store a pointer to the root, which can be useful for debugging. This also
relieves the mm code from the duty of updating it.
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/workingset.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/mm/workingset.c b/mm/workingset.c index abb58ffa3c64..80c913c89f11 100644 --- a/mm/workingset.c +++ b/mm/workingset.c @@ -354,10 +354,8 @@ void workingset_update_node(struct radix_tree_node *node, void *private) * as node->private_list is protected by &mapping->tree_lock. */ if (node->count && node->count == node->exceptional) { - if (list_empty(&node->private_list)) { - node->private_data = mapping; + if (list_empty(&node->private_list)) list_lru_add(&shadow_nodes, &node->private_list); - } } else { if (!list_empty(&node->private_list)) list_lru_del(&shadow_nodes, &node->private_list); @@ -435,7 +433,7 @@ static enum lru_status shadow_lru_isolate(struct list_head *item, */ node = container_of(item, struct radix_tree_node, private_list); - mapping = node->private_data; + mapping = container_of(node->root, struct address_space, page_tree); /* Coming from the list, invert the lock order */ if (!spin_trylock(&mapping->tree_lock)) { |