lkml.org 
[lkml]   [2001]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] add PF_MEMALLOC to __alloc_pages()
Hi Linus, Alan, Mike,

the following patch sets PF_MEMALLOC for the current task
in __alloc_pages() to avoid infinite recursion when we try
to free memory from __alloc_pages().

Please apply the patch below, which fixes this (embarrasing)
bug...

regards,

Rik
--
Hollywood goes for world dumbination,
Trailer at 11.

http://www.surriel.com/
http://www.conectiva.com/ http://distro.conectiva.com.br/



--- linux-2.4.0-prerelease/mm/page_alloc.c.orig Wed Jan 3 12:52:13 2001
+++ linux-2.4.0-prerelease/mm/page_alloc.c Wed Jan 3 13:01:19 2001
@@ -427,7 +427,9 @@
if (order > 0 && (gfp_mask & __GFP_WAIT)) {
zone = zonelist->zones;
/* First, clean some dirty pages. */
+ current->flags |= PF_MEMALLOC;
page_launder(gfp_mask, 1);
+ current->flags &= ~PF_MEMALLOC;
for (;;) {
zone_t *z = *(zone++);
if (!z)
@@ -475,7 +477,9 @@
* free ourselves...
*/
} else if (gfp_mask & __GFP_WAIT) {
+ current->flags |= PF_MEMALLOC;
try_to_free_pages(gfp_mask);
+ current->flags &= ~PF_MEMALLOC;
memory_pressure++;
if (!order)
goto try_again;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

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