patch-2.1.91 linux/mm/filemap.c

Next file: linux/mm/mprotect.c
Previous file: linux/lib/vsprintf.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.90/linux/mm/filemap.c linux/mm/filemap.c
@@ -150,6 +150,10 @@
 				}
 				tmp = tmp->b_this_page;
 			} while (tmp != bh);
+
+			/* Refuse to swap out all buffer pages */
+			if ((buffermem >> PAGE_SHIFT) * 100 < (buffer_mem.min_percent * num_physpages))
+				goto next;
 		}
 
 		/* We can't throw away shared pages, but we do mark
@@ -167,7 +171,7 @@
 						break;
 					}
 					age_page(page);
-					if (page->age)
+					if (page->age || page_cache_size * 100 < (page_cache.min_percent * num_physpages))
 						break;
 					if (PageSwapCache(page)) {
 						delete_from_swap_cache(page);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov