linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* 2.2.15pre4 VM fix
@ 2000-01-26  0:20 Rik van Riel
  2000-01-28 12:09 ` Ivan Kokshaysky
  0 siblings, 1 reply; 6+ messages in thread
From: Rik van Riel @ 2000-01-26  0:20 UTC (permalink / raw)
  To: Alan Cox; +Cc: Linux MM, Linux Kernel

Hi Alan,

with the attached patch I hope to have fixed the 2.2.15pre4
VM problems. I didn't manage to break it myself, but maybe
one of the dear readers has a machine where they are able
to do so...

Please give this patch (against 2.2.15pre4) a solid beating
and report back to us. Thanks all!

regards,

Rik
--
The Internet is not a network of computers. It is a network
of people. That is its real strength.


--- mm/page_alloc.c.orig	Tue Jan 25 00:01:43 2000
+++ mm/page_alloc.c	Wed Jan 26 01:16:21 2000
@@ -210,6 +210,12 @@
 	 */
 	if (!(current->flags & PF_MEMALLOC)) {
 		int freed;
+		if (current->state != TASK_RUNNING && (gfp_mask & __GFP_WAIT)) {
+			printk("gfp called by non-running (%d) task from %p!\n",
+				current->state, __builtin_return_address(0));
+			/* if we're not running, we can't sleep */
+			gfp_mask &= ~__GFP_WAIT;
+		}
 
 		if (nr_free_pages <= freepages.low) {
 			wake_up_interruptible(&kswapd_wait);
@@ -224,6 +230,9 @@
 		current->flags |= PF_MEMALLOC;
 		freed = try_to_free_pages(gfp_mask);
 		current->flags &= ~PF_MEMALLOC;
+
+		if ((gfp_mask & __GFP_MED) && nr_free_pages > freepages.min / 2)
+			goto ok_to_allocate;
 
 		if (!freed && !(gfp_mask & __GFP_HIGH))
 			goto nopage;

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2000-01-28 17:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-01-26  0:20 2.2.15pre4 VM fix Rik van Riel
2000-01-28 12:09 ` Ivan Kokshaysky
2000-01-28 14:40   ` Alan Cox
2000-01-28 16:29     ` Theodore Y. Ts'o
2000-01-28 16:48     ` Ivan Kokshaysky
2000-01-28 17:26       ` Theodore Y. Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox