diff options
author | Matthew Wilcox <mawilcox@microsoft.com> | 2017-01-16 17:10:21 -0500 |
---|---|---|
committer | Matthew Wilcox <mawilcox@microsoft.com> | 2017-02-13 21:44:05 -0500 |
commit | d58275bc96ae933b1b3888af80920dd6b020c505 (patch) | |
tree | e1acf252dc43eeb1d65e4f715b0a1d52b1b4af09 /mm/workingset.c | |
parent | 1293d5c5f54d5118fbb34fc94e01ba02fcd25fc1 (diff) |
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/workingset.c')
-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) | |||
354 | * as node->private_list is protected by &mapping->tree_lock. | 354 | * as node->private_list is protected by &mapping->tree_lock. |
355 | */ | 355 | */ |
356 | if (node->count && node->count == node->exceptional) { | 356 | if (node->count && node->count == node->exceptional) { |
357 | if (list_empty(&node->private_list)) { | 357 | if (list_empty(&node->private_list)) |
358 | node->private_data = mapping; | ||
359 | list_lru_add(&shadow_nodes, &node->private_list); | 358 | list_lru_add(&shadow_nodes, &node->private_list); |
360 | } | ||
361 | } else { | 359 | } else { |
362 | if (!list_empty(&node->private_list)) | 360 | if (!list_empty(&node->private_list)) |
363 | list_lru_del(&shadow_nodes, &node->private_list); | 361 | list_lru_del(&shadow_nodes, &node->private_list); |
@@ -435,7 +433,7 @@ static enum lru_status shadow_lru_isolate(struct list_head *item, | |||
435 | */ | 433 | */ |
436 | 434 | ||
437 | node = container_of(item, struct radix_tree_node, private_list); | 435 | node = container_of(item, struct radix_tree_node, private_list); |
438 | mapping = node->private_data; | 436 | mapping = container_of(node->root, struct address_space, page_tree); |
439 | 437 | ||
440 | /* Coming from the list, invert the lock order */ | 438 | /* Coming from the list, invert the lock order */ |
441 | if (!spin_trylock(&mapping->tree_lock)) { | 439 | if (!spin_trylock(&mapping->tree_lock)) { |