mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00
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/20250421-workingset-simplify-v1-1-de5c40051e0e@suse.de Signed-off-by: Pedro Falcato <pfalcato@suse.de> Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
31cf0dd945
commit
551c643fb2
@ -612,7 +612,6 @@ struct list_lru shadow_nodes;
|
|||||||
|
|
||||||
void workingset_update_node(struct xa_node *node)
|
void workingset_update_node(struct xa_node *node)
|
||||||
{
|
{
|
||||||
struct address_space *mapping;
|
|
||||||
struct page *page = virt_to_page(node);
|
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
|
* already where they should be. The list_empty() test is safe
|
||||||
* as node->private_list is protected by the i_pages lock.
|
* as node->private_list is protected by the i_pages lock.
|
||||||
*/
|
*/
|
||||||
mapping = container_of(node->array, struct address_space, i_pages);
|
lockdep_assert_held(&node->array->xa_lock);
|
||||||
lockdep_assert_held(&mapping->i_pages.xa_lock);
|
|
||||||
|
|
||||||
if (node->count && node->count == node->nr_values) {
|
if (node->count && node->count == node->nr_values) {
|
||||||
if (list_empty(&node->private_list)) {
|
if (list_empty(&node->private_list)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user