lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250421-workingset-simplify-v1-1-de5c40051e0e@suse.de>
Date: Mon, 21 Apr 2025 18:16:28 +0100
From: Pedro Falcato <pfalcato@...e.de>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org, 
 Pedro Falcato <pfalcato@...e.de>
Subject: [PATCH] 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.

Signed-off-by: Pedro Falcato <pfalcato@...e.de>
---
 mm/workingset.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/mm/workingset.c b/mm/workingset.c
index 4841ae8af41113797378846f08336cd7c5757bd5..6e7f4cb1b9a7807e9288955f180a5b6cffab1a40 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)) {

---
base-commit: 856ddd6c69a1a1935f32de8411550d997bcbe6f5
change-id: 20250421-workingset-simplify-eef38019a78c

Best regards,
-- 
Pedro Falcato <pfalcato@...e.de>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ