patch-2.1.45 linux/mm/vmscan.c

Next file: linux/net/Config.in
Previous file: linux/mm/swapfile.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.44/linux/mm/vmscan.c linux/mm/vmscan.c
@@ -362,13 +362,22 @@
 				return 1;
 			state = 1;
 		case 1:
-			if (kmem_cache_reap(i, dma, wait))
-				return 1;
+			shrink_dcache();
 			state = 2;
 		case 2:
-			if (shm_swap(i, dma))
+			/*
+			 * We shouldn't have a priority here:
+			 * If we're low on memory we should
+			 * unconditionally throw away _all_
+			 * kmalloc caches!
+			 */
+			if (kmem_cache_reap(0, dma, wait))
 				return 1;
 			state = 3;
+		case 3:
+			if (shm_swap(i, dma))
+				return 1;
+			state = 4;
 		default:
 			if (swap_out(i, dma, wait))
 				return 1;

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