]> git.neil.brown.name Git - history.git/commitdiff
Import 2.3.8pre2 2.3.8pre2
authorLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:25:41 +0000 (15:25 -0500)
committerLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:25:41 +0000 (15:25 -0500)
mm/filemap.c

index 6d714c3d12632652b6fed20dce93e8484d786858..85eaa298072bc24c7c45758a21093eb1ce606a47 100644 (file)
@@ -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