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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1265929584-5080-4-git-send-email-jack@suse.cz>
Date:	Fri, 12 Feb 2010 00:06:24 +0100
From:	Jan Kara <jack@...e.cz>
To:	LKML <linux-kernel@...r.kernel.org>
Cc:	Andrew Morton <akpm@...ux-foundation.org>, npiggin@...e.de,
	fengguang.wu@...el.com, Jan Kara <jack@...e.cz>
Subject: [PATCH 3/3] mm: Debugging of new livelock avoidance

Make some paranoic checks to verify that code does what it's expected to do.

Signed-off-by: Jan Kara <jack@...e.cz>
---
 mm/page-writeback.c |   39 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index f37cbc2..a389feb 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -822,6 +822,45 @@ void tag_pages_for_writeback(struct address_space *mapping,
 	spin_lock_irq(&mapping->tree_lock);
 	radix_tree_gang_tag_if_tagged(&mapping->page_tree, start, end,
 				PAGECACHE_TAG_DIRTY, PAGECACHE_TAG_TOWRITE);
+	/* Debugging aid */
+	{
+	int i;
+	pgoff_t index;
+	unsigned int nr_pages;
+	struct pagevec pvec;
+
+	index = start;
+	do {
+		nr_pages = pagevec_lookup_tag(&pvec, mapping, &index,
+			      PAGECACHE_TAG_DIRTY,
+			      min(end - index, (pgoff_t)PAGEVEC_SIZE-1) + 1);
+		for (i = 0; i < nr_pages; i++) {
+			if (pvec.pages[i]->index > end) {
+				nr_pages = 0;
+				break;
+			}
+			if (!radix_tree_tag_get(&mapping->page_tree, pvec.pages[i]->index, PAGECACHE_TAG_TOWRITE))
+				printk("Seeing DIRTY !TOWRITE page %lu, state %lu\n", pvec.pages[i]->index, pvec.pages[i]->flags);
+		}
+		pagevec_release(&pvec);
+	} while (nr_pages);
+
+	index = start;
+	do {
+		nr_pages = pagevec_lookup_tag(&pvec, mapping, &index,
+			      PAGECACHE_TAG_TOWRITE,
+			      min(end - index, (pgoff_t)PAGEVEC_SIZE-1) + 1);
+		for (i = 0; i < nr_pages; i++) {
+			if (pvec.pages[i]->index > end) {
+				nr_pages = 0;
+				break;
+			}
+			if (!radix_tree_tag_get(&mapping->page_tree, pvec.pages[i]->index, PAGECACHE_TAG_DIRTY))
+				printk("Seeing !DIRTY TOWRITE page %lu, state %lu\n", pvec.pages[i]->index, pvec.pages[i]->flags);
+		}
+		pagevec_release(&pvec);
+	} while (nr_pages);
+	}
 	spin_unlock_irq(&mapping->tree_lock);
 }
 EXPORT_SYMBOL(tag_pages_for_writeback);
-- 
1.6.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ