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;
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
/* 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);
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