>From 8f01c60e8be5d5671b09b07a5fb647177e33293d Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Wed, 11 May 2016 11:14:11 +0200 Subject: [PATCH] Debugging workingset Signed-off-by: Jan Kara --- mm/workingset.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/mm/workingset.c b/mm/workingset.c index 8a75f8d2916a..b692fc756fda 100644 --- a/mm/workingset.c +++ b/mm/workingset.c @@ -12,6 +12,7 @@ #include #include #include +#include /* * Double CLOCK lists @@ -402,6 +403,7 @@ static enum lru_status shadow_lru_isolate(struct list_head *item, node = container_of(item, struct radix_tree_node, private_list); mapping = node->private_data; + WARN_ON(dax_mapping(mapping)); /* Coming from the list, invert the lock order */ if (!spin_trylock(&mapping->tree_lock)) { @@ -418,7 +420,18 @@ static enum lru_status shadow_lru_isolate(struct list_head *item, * no pages, so we expect to be able to remove them all and * delete and free the empty node afterwards. */ - + if (!node->count || (node->count & RADIX_TREE_COUNT_MASK)) { + printk(KERN_ERR "Wrong node->count %u.\n", node->count); + if (!mapping->host) { + printk(KERN_ERR "Node mapping has no host!\n"); + } else { + printk(KERN_ERR "Host sb %s ino %lu\n", mapping->host->i_sb->s_id, mapping->host->i_ino); + } + printk(KERN_ERR "Node dump:"); + for (i = 0; i < RADIX_TREE_MAP_SIZE; i++) + printk(KERN_CONT " %lx", (unsigned long)node->slots[i]); + printk(KERN_CONT "\n"); + } BUG_ON(!node->count); BUG_ON(node->count & RADIX_TREE_COUNT_MASK); -- 2.6.6