Commit fa08cc83 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] leave truncate's orphaned pages on the LRU

Fix to the page reclaim code from Rik.

Anonymous pages which have buffers arise when
truncate_complete_page()'s call to ->releasepage() failed.  Those pages
may still be mapped into process address spaces.

We should not remove them from the LRU, because that makes them
unswappable and they hang around until process exit.
parent c48c43e6
......@@ -235,19 +235,11 @@ shrink_cache(int nr_pages, zone_t *classzone,
if (try_to_release_page(page, gfp_mask)) {
if (!mapping) {
/*
* We must not allow an anon page
* with no buffers to be visible on
* the LRU, so we unlock the page after
* taking the lru lock
*/
spin_lock(&pagemap_lru_lock);
unlock_page(page);
__lru_cache_del(page);
/* effectively free the page here */
unlock_page(page);
page_cache_release(page);
spin_lock(&pagemap_lru_lock);
if (--nr_pages)
continue;
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment