patch-2.1.98 linux/mm/page_alloc.c

Next file: linux/Makefile
Previous file: linux/kernel/kmod.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.97/linux/mm/page_alloc.c linux/mm/page_alloc.c
@@ -273,10 +273,8 @@
 	 * "maxorder" is the highest order number that we're allowed
 	 * to empty in order to find a free page..
 	 */
-	maxorder = order + NR_MEM_LISTS/3;
-	if (gfp_mask & __GFP_MED)
-		maxorder += NR_MEM_LISTS/3;
-	if ((gfp_mask & __GFP_HIGH) || maxorder > NR_MEM_LISTS)
+	maxorder = NR_MEM_LISTS-1;
+	if (gfp_mask & __GFP_HIGH)
 		maxorder = NR_MEM_LISTS;
 
 	if (in_interrupt() && (gfp_mask & __GFP_WAIT)) {
@@ -295,6 +293,7 @@
 	if (gfp_mask & __GFP_WAIT) {
 		int freed = try_to_free_pages(gfp_mask,SWAP_CLUSTER_MAX);
 		gfp_mask &= ~__GFP_WAIT;	/* go through this only once */
+		maxorder = NR_MEM_LISTS;	/* Allow anything this time */
 		if (freed)
 			goto repeat;
 	}


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