From 7f0e0da1fb514c30df296e22481761b77f6d3a6a Mon Sep 17 00:00:00 2001 From: Sergio López Date: Thu, 29 Sep 2011 11:44:40 +0200 Subject: Sync pager before clearing MAY_CACHE flag Clearing MAY_CACHE flag on a pager initiates a memory object termination if this one is not referenced anymore. If the object has a significant number of dirty pages (i.e. a file recently created was unlinked before diskfs periodical sync) this operation generates a lot of stress on the translator. This is one of the most common sources for thread storms. Sync'ing the pager before clearing that flag ensures that there aren't dirty pages in the object before its termination. * ext2fs/pager.c (drop_pager_softrefs): Sync pager before clearing MAY_CACHE flag. --- ext2fs/pager.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ext2fs') diff --git a/ext2fs/pager.c b/ext2fs/pager.c index 082537cd..0136f9b1 100644 --- a/ext2fs/pager.c +++ b/ext2fs/pager.c @@ -851,7 +851,10 @@ drop_pager_softrefs (struct node *node) spin_unlock (&node_to_page_lock); if (MAY_CACHE && pager) - pager_change_attributes (pager, 0, MEMORY_OBJECT_COPY_DELAY, 0); + { + pager_sync (pager, 0); + pager_change_attributes (pager, 0, MEMORY_OBJECT_COPY_DELAY, 0); + } if (pager) ports_port_deref (pager); } -- cgit v1.2.3