Skip to content

Commit

Permalink
mm: workingset: replace IRQ-off check with a lockdep assert.
Browse files Browse the repository at this point in the history
Commit

  68d48e6 ("mm: workingset: add vmstat counter for shadow nodes")

introduced an IRQ-off check to ensure that a lock is held which also
disabled interrupts. This does not work the same way on -RT because none
of the locks, that are held, disable interrupts.
Replace this check with a lockdep assert which ensures that the lock is
held.

Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://https://lkml.kernel.org/r/.kernel.org/linux-mm/20190211113829.sqf6bdi4c4cdd3rp@linutronix.de/
  • Loading branch information
Sebastian Andrzej Siewior committed Sep 13, 2021
1 parent fcdcdbf commit 9317f6c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mm/workingset.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,8 @@ static struct list_lru shadow_nodes;

void workingset_update_node(struct xa_node *node)
{
struct address_space *mapping;

/*
* Track non-empty nodes that contain only shadow entries;
* unlink those that contain pages or are being freed.
Expand All @@ -440,7 +442,8 @@ 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.
*/
VM_WARN_ON_ONCE(!irqs_disabled()); /* For __inc_lruvec_page_state */
mapping = container_of(node->array, struct address_space, i_pages);
lockdep_assert_held(&mapping->i_pages.xa_lock);

if (node->count && node->count == node->nr_values) {
if (list_empty(&node->private_list)) {
Expand Down

0 comments on commit 9317f6c

Please sign in to comment.