patch-2.4.0-test4 linux/mm/page_alloc.c

Next file: linux/mm/slab.c
Previous file: linux/mm/memory.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test3/linux/mm/page_alloc.c linux/mm/page_alloc.c
@@ -227,6 +227,23 @@
 	 * We are falling back to lower-level zones if allocation
 	 * in a higher zone fails.
 	 */
+
+	for (;;) {
+		zone_t *z = *(zone++);
+		if (!z)
+			break;
+		if (!z->size)
+			BUG();
+
+		/* If there are zones with a lot of free memory allocate from them */
+		if (z->free_pages > z->pages_high) {
+			struct page *page = rmqueue(z, order);
+			if (page)
+				return page;
+		}
+	}
+
+	zone = zonelist->zones;
 	for (;;) {
 		zone_t *z = *(zone++);
 		if (!z)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)