aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPedro Falcato <[email protected]>2025-04-21 17:16:28 +0000
committerAndrew Morton <[email protected]>2025-05-13 06:50:44 +0000
commit551c643fb29a221e8fcd00ff680a364a73deb2f3 (patch)
treef3e670825450fcfcbf06186702d7a78a6bca1906
parentmm/mm_init: use for_each_valid_pfn() in init_unavailable_range() (diff)
downloadkernel-551c643fb29a221e8fcd00ff680a364a73deb2f3.tar.gz
kernel-551c643fb29a221e8fcd00ff680a364a73deb2f3.zip
mm: workingset: simplify lockdep check in update_node
container_of(node->array, ..., i_pages) just to access i_pages again is an incredibly roundabout way of accessing node->array itself. Simplify it. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Pedro Falcato <[email protected]> Reviewed-by: Matthew Wilcox (Oracle) <[email protected]> Acked-by: Johannes Weiner <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
-rw-r--r--mm/workingset.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/mm/workingset.c b/mm/workingset.c
index 4841ae8af411..6e7f4cb1b9a7 100644
--- a/mm/workingset.c
+++ b/mm/workingset.c
@@ -612,7 +612,6 @@ struct list_lru shadow_nodes;
void workingset_update_node(struct xa_node *node)
{
- struct address_space *mapping;
struct page *page = virt_to_page(node);
/*
@@ -623,8 +622,7 @@ void workingset_update_node(struct xa_node *node)
* already where they should be. The list_empty() test is safe
* as node->private_list is protected by the i_pages lock.
*/
- mapping = container_of(node->array, struct address_space, i_pages);
- lockdep_assert_held(&mapping->i_pages.xa_lock);
+ lockdep_assert_held(&node->array->xa_lock);
if (node->count && node->count == node->nr_values) {
if (list_empty(&node->private_list)) {