patch-2.3.47 linux/mm/page_alloc.c

Next file: linux/net/Changes
Previous file: linux/mm/mremap.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.46/linux/mm/page_alloc.c linux/mm/page_alloc.c
@@ -258,7 +258,9 @@
 		 */
 		if (!(current->flags & PF_MEMALLOC))
 		{
-			if (classfree(z) > z->pages_high)
+			unsigned long free = classfree(z);
+
+			if (free > z->pages_high)
 			{
 				if (z->low_on_memory)
 					z->low_on_memory = 0;
@@ -270,11 +272,11 @@
 				if (z->low_on_memory)
 					goto balance;
 
-				if (classfree(z) <= z->pages_low)
+				if (free <= z->pages_low)
 				{
 					wake_up_interruptible(&kswapd_wait);
 
-					if (classfree(z) <= z->pages_min)
+					if (free <= z->pages_min)
 					{
 						z->low_on_memory = 1;
 						goto balance;
@@ -296,16 +298,6 @@
 			if (page)
 				return page;
 		}
-	}
-
-	/*
-	 * If we can schedule, do so, and make sure to yield.
-	 * We may be a real-time process, and if kswapd is
-	 * waiting for us we need to allow it to run a bit.
-	 */
-	if (gfp_mask & __GFP_WAIT) {
-		current->policy |= SCHED_YIELD;
-		schedule();
 	}
 
 nopage:

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