lkml.org 
[lkml]   [2001]   [Jun]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] Avoid !__GFP_IO allocations to eat from memory reservations

Message-ID: <Pine.LNX.4.21.0106140949550.8439-100000@freak.distro.conectiva>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII


Linus,

In pre3, GFP_BUFFER allocations can eat from the "emergency" memory
reservations in case try_to_free_pages() fails for those allocations in
__alloc_pages().


Here goes the (tested) patch to fix that:


--- linux/mm/page_alloc.c.orig Thu Jun 14 11:00:14 2001
+++ linux/mm/page_alloc.c Thu Jun 14 11:32:56 2001
@@ -453,6 +453,12 @@
int progress = try_to_free_pages(gfp_mask);
if (progress || gfp_mask & __GFP_IO)
goto try_again;
+ /*
+ * Fail in case no progress was made and the
+ * allocation may not be able to block on IO.
+ */
+ else
+ return NULL;
}
}
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:55    [W:0.190 / U:0.796 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site