From f1821d889ea73ea0eff163f6bc880db7588005bd Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 23 Nov 2007 15:25:41 -0500 Subject: [PATCH] Import 2.3.8pre2 --- mm/filemap.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mm/filemap.c b/mm/filemap.c index 6d714c3d1..85eaa2980 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -214,7 +214,7 @@ extern atomic_t too_many_dirty_buffers; int shrink_mmap(int priority, int gfp_mask) { static unsigned long clock = 0; - unsigned long limit = num_physpages; + unsigned long limit = num_physpages << 1; struct page * page; int count, users; @@ -245,6 +245,8 @@ int shrink_mmap(int priority, int gfp_mask) if ((gfp_mask & __GFP_DMA) && !PageDMA(page)) continue; + count--; + /* * Some common cases that we just short-circuit without * getting the locks - we need to re-check this once we @@ -290,7 +292,6 @@ int shrink_mmap(int priority, int gfp_mask) /* Is it a buffer page? */ if (page->buffers) { spin_unlock(&pagecache_lock); - count--; if (try_to_free_buffers(page)) goto made_progress; spin_lock(&pagecache_lock); @@ -300,8 +301,6 @@ int shrink_mmap(int priority, int gfp_mask) if (page_count(page) != 2) goto spin_unlock_continue; - count--; - /* * Is it a page swap page? If so, we want to * drop it if it is no longer used, even if it -- 2.11.4.GIT