All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm: workingset: replace IRQ-off check with a lockdep assert.
@ 2019-02-11  9:57 Sebastian Andrzej Siewior
  2019-02-11 11:38 ` [PATCH v2] " Sebastian Andrzej Siewior
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Sebastian Andrzej Siewior @ 2019-02-11  9:57 UTC (permalink / raw)
  To: linux-mm; +Cc: Johannes Weiner, Peter Zijlstra, Andrew Morton, Thomas Gleixner

Commit

  68d48e6a2df57 ("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.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 mm/workingset.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/mm/workingset.c b/mm/workingset.c
index dcb994f2acc2e..c75d10d48be16 100644
--- a/mm/workingset.c
+++ b/mm/workingset.c
@@ -368,6 +368,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.
@@ -376,7 +378,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_is_held(&mapping->i_pages.xa_lock);
 
 	if (node->count && node->count == node->nr_values) {
 		if (list_empty(&node->private_list)) {
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-08-21 15:22 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-11  9:57 [PATCH] mm: workingset: replace IRQ-off check with a lockdep assert Sebastian Andrzej Siewior
2019-02-11 11:38 ` [PATCH v2] " Sebastian Andrzej Siewior
2019-02-11 18:53   ` Johannes Weiner
2019-02-11 19:13     ` Sebastian Andrzej Siewior
2019-02-11 19:17       ` Matthew Wilcox
2019-02-11 19:41         ` Sebastian Andrzej Siewior
2019-02-11 21:02       ` Johannes Weiner
2019-02-13  9:27         ` Sebastian Andrzej Siewior
2019-02-13 14:56           ` Johannes Weiner
2019-08-21 11:21             ` Sebastian Andrzej Siewior
2019-08-21 15:21               ` Johannes Weiner
2019-02-11 17:07 ` [PATCH] " kbuild test robot
2019-02-11 17:37 ` kbuild test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.